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.
This commit is contained in:
foormea 2021-05-30 21:39:46 +02:00 committed by GitHub
commit 8cab3de7c4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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 <your.HA.instance.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";
}
}