Update nginx.conf
This commit is contained in:
parent
81705866f8
commit
033b5bdb19
27
nginx.conf
27
nginx.conf
|
@ -11,22 +11,16 @@ http {
|
||||||
server {
|
server {
|
||||||
listen 80;
|
listen 80;
|
||||||
|
|
||||||
# Define MIME type
|
|
||||||
types {
|
|
||||||
text/html html htm shtml;
|
|
||||||
}
|
|
||||||
|
|
||||||
# Health check location at a secret path
|
# Health check location at a secret path
|
||||||
location /secret-health-path {
|
location /secret-health-path {
|
||||||
# A simple response to indicate Nginx is running
|
|
||||||
add_header Content-Type text/plain;
|
add_header Content-Type text/plain;
|
||||||
return 200 'Healthy';
|
return 200 'Healthy';
|
||||||
}
|
}
|
||||||
|
|
||||||
location / {
|
location / {
|
||||||
# Use the placeholders for the proxy pass
|
# Proxy pass to the backend using environment variables with HTTP explicitly
|
||||||
proxy_pass ${PROTOCOL}://${BACKEND_ADDRESS}:${BACKEND_PORT};
|
proxy_pass http://${BACKEND_ADDRESS}:${BACKEND_PORT};
|
||||||
|
|
||||||
# General proxy settings
|
# General proxy settings
|
||||||
proxy_http_version 1.1;
|
proxy_http_version 1.1;
|
||||||
proxy_set_header Host $host;
|
proxy_set_header Host $host;
|
||||||
|
@ -34,16 +28,17 @@ http {
|
||||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||||
proxy_set_header Accept-Encoding "";
|
proxy_set_header Accept-Encoding "";
|
||||||
proxy_buffering off;
|
proxy_buffering off;
|
||||||
proxy_ssl_verify off; # Skip SSL verification, be cautious
|
|
||||||
|
|
||||||
# Do not alter the Connection header; let the backend and client negotiate that
|
# Remove headers that might hint at HTTPS usage
|
||||||
proxy_set_header Connection $http_connection;
|
proxy_set_header X-Forwarded-Proto "";
|
||||||
|
proxy_set_header X-Forwarded-Ssl "";
|
||||||
|
proxy_set_header X-Url-Scheme "";
|
||||||
|
|
||||||
# Preserve the request scheme for the backend application
|
# Disable proxy_ssl_verify if you're not using HTTPS at all
|
||||||
proxy_set_header X-Forwarded-Proto $scheme;
|
proxy_ssl_verify off;
|
||||||
|
|
||||||
# Allow the backend to serve the correct protocol URLs
|
# Do not pass through the Connection header from the client
|
||||||
proxy_redirect off;
|
proxy_set_header Connection "";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue