summaryrefslogtreecommitdiffstats
path: root/makefu/2configs/home/ham/nginx.nix
diff options
context:
space:
mode:
Diffstat (limited to 'makefu/2configs/home/ham/nginx.nix')
-rw-r--r--makefu/2configs/home/ham/nginx.nix15
1 files changed, 15 insertions, 0 deletions
diff --git a/makefu/2configs/home/ham/nginx.nix b/makefu/2configs/home/ham/nginx.nix
new file mode 100644
index 000000000..e166b2a4b
--- /dev/null
+++ b/makefu/2configs/home/ham/nginx.nix
@@ -0,0 +1,15 @@
+let
+ internal-ip = "192.168.1.11";
+in {
+ services.nginx.recommendedProxySettings = true;
+ services.nginx.virtualHosts."hass" = {
+ serverAliases = [ "hass.lan" "ha" "ha.lan" ];
+ locations."/".proxyPass = "http://localhost:8123";
+ locations."/".proxyWebsockets = true;
+ extraConfig = ''
+ if ( $server_addr != "${internal-ip}" ) {
+ return 403;
+ }
+ '';
+ };
+}