diff --git a/profiles/templates/homeassistant/nginx/homeassistant.conf b/profiles/templates/homeassistant/nginx/homeassistant.conf index 08d24f2..864ed0c 100644 --- a/profiles/templates/homeassistant/nginx/homeassistant.conf +++ b/profiles/templates/homeassistant/nginx/homeassistant.conf @@ -1,9 +1,22 @@ # Calculate path=/etc/nginx/sites-enabled exists(/etc/nginx/sites-enabled/#-cut()-#)== comment=# +map $http_upgrade $connection_upgrade { + default upgrade; + '' close; +} server { - listen 80 default_server; - location / { - proxy_set_header X-Forwarded-For $remote_addr; - proxy_set_header Host $http_host; - proxy_pass "http://127.0.0.1:8123"; - } + listen 80; + location / { + proxy_pass "http://127.0.0.1:8123"; + proxy_connect_timeout 60; + proxy_http_version 1.1; + proxy_intercept_errors off; + proxy_read_timeout 60; + proxy_send_timeout 60; + proxy_set_header Connection $connection_upgrade; + proxy_set_header Host $http_host; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header X-Forwarded-For $remote_addr; + proxy_set_header X-Forwarded-Proto $scheme; + proxy_set_header X-Real-IP $remote_addr; + } } diff --git a/scripts/homeassistant/step/2-config.sh b/scripts/homeassistant/step/2-config.sh index 9ee9ab9..8eb34c9 100755 --- a/scripts/homeassistant/step/2-config.sh +++ b/scripts/homeassistant/step/2-config.sh @@ -23,6 +23,7 @@ kill $id_hass cat >> ~/.homeassistant/configuration.yaml <