move Connection and Upgrade headers, remove 2nd location section

This commit is contained in:
Laszlo Magyar
2025-06-29 01:07:22 +02:00
parent 68c2a41b9f
commit a7255c2c5e
2 changed files with 3 additions and 8 deletions

View File

@@ -7,9 +7,7 @@ proxy_send_timeout 30m;
proxy_max_temp_file_size 0;
proxy_set_header Accept-Encoding "";
proxy_set_header Connection $connection_upgrade;
proxy_set_header Origin $http_origin;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-NginX-Proxy true;

View File

@@ -8,13 +8,10 @@ server {
location / {
proxy_pass {{ .protocol }}://backend/;
resolver 127.0.0.11 valid=180s;
proxy_set_header Host $http_host;
proxy_set_header X-Forwarded-Host $http_host;
}
location /api/websocket/ {
proxy_pass {{ .protocol }}://backend/api/websocket/;
resolver 127.0.0.11 valid=180s;
# These headers must be under location section, if they moved into proxy_params.conf, even if this is valid, they won't work
proxy_set_header Connection $connection_upgrade;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Host $http_host;
proxy_set_header X-Forwarded-Host $http_host;
}