From 01028cb07547e5388bae3d849a6f7e09961922d2 Mon Sep 17 00:00:00 2001 From: makefu Date: Fri, 12 Mar 2021 20:27:57 +0100 Subject: ma ham: protect application server from external requests --- 2configs/home/ham/nginx.nix | 5 +++++ 1 file changed, 5 insertions(+) (limited to '2configs/home/ham') diff --git a/2configs/home/ham/nginx.nix b/2configs/home/ham/nginx.nix index 2048ff215..e166b2a4b 100644 --- a/2configs/home/ham/nginx.nix +++ b/2configs/home/ham/nginx.nix @@ -6,5 +6,10 @@ in { serverAliases = [ "hass.lan" "ha" "ha.lan" ]; locations."/".proxyPass = "http://localhost:8123"; locations."/".proxyWebsockets = true; + extraConfig = '' + if ( $server_addr != "${internal-ip}" ) { + return 403; + } + ''; }; } -- cgit v1.2.3