1
0
Fork 0

Update nginx.conf

This commit is contained in:
colin 2023-11-21 18:11:27 +00:00
parent 81705866f8
commit 033b5bdb19
1 changed files with 11 additions and 16 deletions

View File

@ -11,22 +11,16 @@ http {
server {
listen 80;
# Define MIME type
types {
text/html html htm shtml;
}
# Health check location at a secret path
location /secret-health-path {
# A simple response to indicate Nginx is running
add_header Content-Type text/plain;
return 200 'Healthy';
}
location / {
# Use the placeholders for the proxy pass
proxy_pass ${PROTOCOL}://${BACKEND_ADDRESS}:${BACKEND_PORT};
# Proxy pass to the backend using environment variables with HTTP explicitly
proxy_pass http://${BACKEND_ADDRESS}:${BACKEND_PORT};
# General proxy settings
proxy_http_version 1.1;
proxy_set_header Host $host;
@ -34,16 +28,17 @@ http {
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Accept-Encoding "";
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
proxy_set_header Connection $http_connection;
# Remove headers that might hint at HTTPS usage
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
proxy_set_header X-Forwarded-Proto $scheme;
# Disable proxy_ssl_verify if you're not using HTTPS at all
proxy_ssl_verify off;
# Allow the backend to serve the correct protocol URLs
proxy_redirect off;
# Do not pass through the Connection header from the client
proxy_set_header Connection "";
}
}
}