From 8cab3de7c4d1f408b853810dd01e5a2c09f87b43 Mon Sep 17 00:00:00 2001 From: foormea <48879632+foormea@users.noreply.github.com> Date: Sun, 30 May 2021 21:39:46 +0200 Subject: [PATCH] working homeassistant.subdomain.conf config file Some headers seem to always be necessary. I also added a (commented out) way to configure this module, as on my side, I don't want my HA instance to be reachable solely over https -- I also want to be able to reach the instance locally even when the outside internet connection is down. --- homeassistant.subdomain.conf.sample | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/homeassistant.subdomain.conf.sample b/homeassistant.subdomain.conf.sample index 5e91d62..902fb8e 100644 --- a/homeassistant.subdomain.conf.sample +++ b/homeassistant.subdomain.conf.sample @@ -1,4 +1,4 @@ -## Version 2021/05/18 +## Version 2021-05-30 # make sure that your dns has a cname set for homeassistant and that your homeassistant container is not using a base url server { @@ -16,6 +16,9 @@ server { # enable for Authelia #include /config/nginx/authelia-server.conf; + + # in case the service is running on `host` networking + # set $upstream_IP location / { # enable the next two lines for http auth @@ -35,7 +38,14 @@ server { set $upstream_port 8123; set $upstream_proto http; proxy_pass $upstream_proto://$upstream_app:$upstream_port; + + # in case the service is running on `host` networking, use this instead: + # proxy_pass $upstream_proto://$upstream_IP:$upstream_port; + # these seem to be needed: + proxy_set_header Host $host; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "upgrade"; } location /api { @@ -45,5 +55,13 @@ server { set $upstream_port 8123; set $upstream_proto http; proxy_pass $upstream_proto://$upstream_app:$upstream_port; + + # in case the service is running on `host` networking, use this instead: + # proxy_pass $upstream_proto://$upstream_IP:$upstream_port; + + # these seem to be needed: + proxy_set_header Host $host; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "upgrade"; } }