mirror of
https://github.com/alexbelgium/hassio-addons.git
synced 2026-09-09 19:29:10 +02:00
Ingress responses were re-gzipped by nginx (default gzip_types includes text/html), dropping Content-Length and forcing a chunked/streamed response. That pushes both Supervisor and Core's ingress proxy out of their buffered relay path into the streaming path, where an aiohttp-side error surfaces to the browser as a 502 Bad Gateway even though the addon's own nginx logs a 200. Disabling gzip on the ingress server block keeps responses identity-encoded with an intact Content-Length so the relay uses the simpler, more robust buffered path. Fixes #2766
25 lines
847 B
Groovy
25 lines
847 B
Groovy
server {
|
|
listen {{ .interface }}:{{ .port }} default_server;
|
|
listen {{ .interface }}:9099 default_server;
|
|
include /etc/nginx/includes/server_params.conf;
|
|
include /etc/nginx/includes/proxy_params.conf;
|
|
client_max_body_size 0;
|
|
gzip off;
|
|
|
|
proxy_hide_header X-Frame-Options;
|
|
proxy_hide_header Content-Security-Policy;
|
|
add_header X-Frame-Options "SAMEORIGIN";
|
|
add_header Content-Security-Policy "frame-ancestors *";
|
|
|
|
location / {
|
|
proxy_pass {{ .protocol }}://backend/;
|
|
resolver 127.0.0.11 valid=180s;
|
|
|
|
# These headers must be under location section, if they moved into proxy_params.conf, even if this is valid, they won't work
|
|
proxy_set_header Connection $connection_upgrade;
|
|
proxy_set_header Upgrade $http_upgrade;
|
|
proxy_set_header Host $http_host;
|
|
proxy_set_header X-Forwarded-Host $http_host;
|
|
}
|
|
}
|