Procházet zdrojové kódy

set proxy_set_header in location block

pull/342/head
Guillaume Vincent před 8 roky
rodič
revize
9155a112e0
1 změnil soubory, kde provedl 16 přidání a 21 odebrání
  1. +16
    -21
      backend.conf.j2

+ 16
- 21
backend.conf.j2 Zobrazit soubor

@@ -43,31 +43,26 @@ server {
resolver 8.8.8.8 8.8.4.4 208.67.222.222 208.67.220.220 valid=300s;
{% endif %}

proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Real-IP $remote_addr;
proxy_redirect off;

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

location /admin/ {
proxy_pass http://backend:8000;
location ~ /(static|media)/ {
autoindex on;
root /backend/www;
}

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

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

location /media/ {
autoindex on;
root /backend/www;
location / {
proxy_pass http://frontend:8080;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_redirect off;
}
}

Načítá se…
Zrušit
Uložit