mirror of
https://github.com/alexbelgium/hassio-addons.git
synced 2026-01-16 01:18:19 +01:00
If is IPv6 enabled, then localhost is resolved as [::1] 2025/06/15 19:24:19 [error] 431#431: *8575 connect() failed (111: Connection refused) while connecting to upstream, client: 172.30.32.2, server: netalertx, request: "GET / HTTP/1.1", upstream: "http://[::1]:20211/", host: "http://homeassistant.local/", referrer: "https:/homeassistant.local:48123/db21ed7f_netalertx_fa"
41 lines
1.3 KiB
Plaintext
41 lines
1.3 KiB
Plaintext
server {
|
|
listen %%interface%%:%%port%% default_server;
|
|
server_name netalertx;
|
|
proxy_buffering off;
|
|
include /etc/nginx/includes/server_params.conf;
|
|
include /etc/nginx/includes/proxy_params.conf;
|
|
|
|
location / {
|
|
proxy_pass http://127.0.0.1:20211/;
|
|
rewrite ^%%ingress_entry%%/?(.*)$ /$1 break;
|
|
sub_filter_once off;
|
|
sub_filter_types *;
|
|
sub_filter 'href="/' 'href="%%ingress_entry%%/';
|
|
sub_filter '(?>$host)/css/' '%%ingress_entry%%/css/';
|
|
sub_filter '(?>$host)/js/' '%%ingress_entry%%/js/';
|
|
sub_filter '/img/' '%%ingress_entry%%/img/';
|
|
sub_filter '/lib/' '%%ingress_entry%%/lib/';
|
|
sub_filter '/php/' '%%ingress_entry%%/php/';
|
|
|
|
# Next three lines allow websockets
|
|
proxy_http_version 1.1;
|
|
proxy_set_header Upgrade $http_upgrade;
|
|
proxy_set_header Connection "upgrade";
|
|
|
|
# Allow downloading fragments
|
|
proxy_set_header Range $http_range;
|
|
proxy_set_header If-Range $http_if_range;
|
|
|
|
# Improve ip handling
|
|
proxy_hide_header X-Powered-By;
|
|
proxy_set_header X-Real-IP $remote_addr;
|
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
|
proxy_set_header X-Forwarded-Proto $scheme;
|
|
proxy_set_header Accept-Encoding "";
|
|
proxy_connect_timeout 30m;
|
|
proxy_send_timeout 30m;
|
|
proxy_read_timeout 30m;
|
|
add_header X-Frame-Options "SAMEORIGIN";
|
|
}
|
|
}
|