File tree Expand file tree Collapse file tree 1 file changed +21
-2
lines changed
Expand file tree Collapse file tree 1 file changed +21
-2
lines changed Original file line number Diff line number Diff line change 66 error_log /var/log/nginx/demo.auth.myvas.error.log;
77
88 # set client body size to 2M
9- #client_max_body_size 8M;
9+ #client_max_body_size 8M;
1010
1111 error_page 502 /502.html;
1212 location = /502.html {
@@ -16,10 +16,29 @@ server {
1616
1717 location / {
1818 proxy_pass http://127.0.0.1:6605;
19+
20+ # Use HTTP/1.1 for backend communication.
1921 proxy_http_version 1.1;
22+
23+ # Forward the `Upgrade` header for WebSocket support.
2024 proxy_set_header Upgrade $http_upgrade;
25+
26+ # Enable persistent connections between Nginx and the backend.
2127 proxy_set_header Connection keep-alive;
28+
29+ # Forward the original `Host` header to the backend.
2230 proxy_set_header Host $host;
23- proxy_cache_bypass $http_upgrade;
31+
32+ # Forward the client's real IP address to the backend.
33+ proxy_set_header X-Real-IP $remote_addr;
34+
35+ # Track the client's IP through proxies.
36+ proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
37+
38+ # Forward the original protocol (HTTP or HTTPS) to the backend.
39+ proxy_set_header X-Forwarded-proto $scheme;
40+
41+ # Bypass the cache for WebSocket requests.
42+ proxy_cache_bypass $http_upgrade;
2443 }
2544}
You can’t perform that action at this time.
0 commit comments