Move proxies to module

This commit is contained in:
Greg Hellings
2022-04-20 11:11:35 -05:00
parent cb3dad8411
commit 2798392892
6 changed files with 90 additions and 24 deletions
+3 -12
View File
@@ -93,18 +93,9 @@ in
# multiple layers of proxies, then add more of them in the list. The list also accepts subnet notation in case you have
# multiple potentially incoming connections. So you could do "10.88.0.1/24", according to the docs. However, that has not
# worked in my testing, as Home Assistant throws an error on start up saying that value is invalid
services.nginx = {
enable= true;
virtualHosts."smart.thehellings.lan".locations."/" = {
proxyPass = "http://127.0.0.1:8123";
extraConfig = ''
proxy_set_header Host $host;
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;
'';
};
greg.proxies."smart.thehellings.lan" = {
target = "http://127.0.0.1:8123";
ssl = false;
};
# Ensure that both ports are up and running. We keep 8123 directly open because we are on the LAN and sometimes want to connect
+7 -7
View File
@@ -5,12 +5,12 @@
{ ... }:
{
services.nginx = {
enable = true;
# A proxy front-end for Syncthing
virtualHosts."dns.thehellings.lan" = {
locations."/sync/".proxyPass = "http://127.0.0.1:8384/";
serverAliases = [ "dns" ];
};
greg.proxies."dns.thehellings.lan" = {
target = "http://127.0.0.1:8384/";
ssl = false;
path = "/sync/";
};
# The module doesn't handle this
services.nginx.virtualHosts."dns.thehellings.lan".serverAliases = [ "dns" ];
}