Bläddra i källkod

simplify nginx conf

pull/342/head
Guillaume Vincent 8 år sedan
förälder
incheckning
0d55032eb8
1 ändrade filer med 20 tillägg och 13 borttagningar
  1. +20
    -13
      backend.conf.j2

+ 20
- 13
backend.conf.j2 Visa fil

@@ -42,22 +42,29 @@ server {
resolver 8.8.8.8 8.8.4.4 208.67.222.222 208.67.220.220 valid=300s;
{% endif %}

location ~ /(static|media)/ {
autoindex on;
root /backend/www;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Scheme $scheme;

location / {
proxy_pass http://frontend:8080;
}

location ~ /(api|admin) {
location /admin/ {
proxy_pass http://backend:8000;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}

location / {
proxy_pass http://frontend:8080;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
location /api/ {
proxy_pass http://backend:8000;
}
}

location /static/ {
autoindex on;
root /backend/www;
}

location /media/ {
autoindex on;
root /backend/www;
}
}

Laddar…
Avbryt
Spara