Przeglądaj źródła

simplify nginx conf

pull/342/head
Guillaume Vincent 8 lat temu
rodzic
commit
0d55032eb8
1 zmienionych plików z 20 dodań i 13 usunięć
  1. +20
    -13
      backend.conf.j2

+ 20
- 13
backend.conf.j2 Wyświetl plik

@@ -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;
}
}

Ładowanie…
Anuluj
Zapisz