2021-03-08 22:41:47 +00:00
|
|
|
let
|
2021-04-08 19:39:39 +00:00
|
|
|
internal-ip = "192.168.111.11";
|
2021-03-08 22:41:47 +00:00
|
|
|
in {
|
|
|
|
services.nginx.recommendedProxySettings = true;
|
|
|
|
services.nginx.virtualHosts."hass" = {
|
|
|
|
serverAliases = [ "hass.lan" "ha" "ha.lan" ];
|
|
|
|
locations."/".proxyPass = "http://localhost:8123";
|
|
|
|
locations."/".proxyWebsockets = true;
|
2021-03-12 19:27:57 +00:00
|
|
|
extraConfig = ''
|
|
|
|
if ( $server_addr != "${internal-ip}" ) {
|
|
|
|
return 403;
|
|
|
|
}
|
|
|
|
'';
|
2021-03-08 22:41:47 +00:00
|
|
|
};
|
|
|
|
}
|