Update nginx.conf
This commit is contained in:
parent
0d1d52f400
commit
81705866f8
25
nginx.conf
25
nginx.conf
|
@ -8,12 +8,6 @@ events {
|
||||||
http {
|
http {
|
||||||
default_type application/octet-stream;
|
default_type application/octet-stream;
|
||||||
|
|
||||||
# Maps for handling WebSocket connections
|
|
||||||
map $http_upgrade $connection_upgrade {
|
|
||||||
default upgrade;
|
|
||||||
'' close;
|
|
||||||
}
|
|
||||||
|
|
||||||
server {
|
server {
|
||||||
listen 80;
|
listen 80;
|
||||||
|
|
||||||
|
@ -30,21 +24,26 @@ http {
|
||||||
}
|
}
|
||||||
|
|
||||||
location / {
|
location / {
|
||||||
# Proxy pass to the backend using environment variables
|
# Use the placeholders for the proxy pass
|
||||||
proxy_pass http://${BACKEND_ADDRESS}:${BACKEND_PORT}; # Always use http for the backend connection
|
proxy_pass ${PROTOCOL}://${BACKEND_ADDRESS}:${BACKEND_PORT};
|
||||||
|
|
||||||
# General proxy settings
|
# General proxy settings
|
||||||
proxy_http_version 1.1;
|
proxy_http_version 1.1;
|
||||||
proxy_set_header Upgrade $http_upgrade;
|
|
||||||
proxy_set_header Connection $connection_upgrade;
|
|
||||||
proxy_set_header Host $host;
|
proxy_set_header Host $host;
|
||||||
proxy_set_header X-Real-IP $remote_addr;
|
proxy_set_header X-Real-IP $remote_addr;
|
||||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||||
# Do not use X-Forwarded-Proto to hide the SSL usage from the backend
|
|
||||||
proxy_set_header Accept-Encoding "";
|
proxy_set_header Accept-Encoding "";
|
||||||
proxy_buffering off;
|
proxy_buffering off;
|
||||||
# Skip SSL verification if you are proxying to an HTTPS backend, though this is typically not recommended
|
proxy_ssl_verify off; # Skip SSL verification, be cautious
|
||||||
proxy_ssl_verify off;
|
|
||||||
|
# Do not alter the Connection header; let the backend and client negotiate that
|
||||||
|
proxy_set_header Connection $http_connection;
|
||||||
|
|
||||||
|
# Preserve the request scheme for the backend application
|
||||||
|
proxy_set_header X-Forwarded-Proto $scheme;
|
||||||
|
|
||||||
|
# Allow the backend to serve the correct protocol URLs
|
||||||
|
proxy_redirect off;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue