fix reverse proxy for HA

This commit is contained in:
Tyler Starr 2023-12-03 12:22:18 -08:00
parent 26fba44457
commit 2567f8703c
2 changed files with 23 additions and 3 deletions

View File

@ -118,9 +118,6 @@
"rss.tstarr.us" = (SSL // {
locations."/".proxyPass = "http://localhost:8087/";
});
"home.tstarr.us" = (SSL // {
locations."/".proxyPass = "http://localhost:8123/";
});
"media.tstarr.us" = (SSL // {
locations."/".proxyPass = "http://localhost:8096/";
});

View File

@ -20,7 +20,30 @@
# Includes dependencies for a basic setup
# https://www.home-assistant.io/integrations/default_config/
default_config = {};
http = {
use_x_forwarded_for = true;
trusted_proxies = [
"127.0.0.1"
"::1"
];
};
};
};
services.nginx.virtualHosts."home.tstarr.us" = {
forceSSL = true;
enableACME = true;
extraConfig = ''
proxy_buffering off;
'';
locations."/".extraConfig = ''
proxy_pass http://localhost:8123;
proxy_set_header Host $host;
proxy_redirect http:// https://;
proxy_http_version 1.1;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $connection_upgrade;
'';
};
}