diff --git a/nginx.conf b/nginx.conf index 9af542a..0c10698 100644 --- a/nginx.conf +++ b/nginx.conf @@ -17,32 +17,32 @@ http { } location / { - # Use the placeholders for the proxy pass - proxy_pass ${PROTOCOL}://${BACKEND_ADDRESS}:${BACKEND_PORT}; + # Use the placeholders for the proxy pass (ensure these are properly substituted) + proxy_pass http://backend:port; # Replace with actual backend address and port proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; - proxy_set_header Connection "Upgrade"; + proxy_set_header Connection $connection_upgrade; # This can handle both Upgrade and close proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; 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 - - # Enable response body filtering - sub_filter_once off; - - # Inject the Matomo content just before -# sub_filter '' ''; - sub_filter '' ''; - sub_filter_types application/xml application/json text/css text/javascript application/javascript text/plain; + # Error handling (example) + error_page 502 /502.html; + location = /502.html { + root /usr/share/nginx/html; + internal; + } } -# location /matomo.js { -# alias /matomo.js; -# types { application/javascript js; } # Explicitly set the MIME type for .js files -# default_type application/javascript; # Setting default MIME type for this location block -# } + # Custom location for WebSocket if needed + # location /ws { + # proxy_pass http://backend:port; + # proxy_http_version 1.1; + # proxy_set_header Upgrade $http_upgrade; + # proxy_set_header Connection "Upgrade"; + # # Other necessary headers... + # } } }