From cd6a3637d4ca727b0f3277e1478130a8aa1fd8c0 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 --- makefu/2configs/home/ham/nginx.nix | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'makefu') diff --git a/makefu/2configs/home/ham/nginx.nix b/makefu/2configs/home/ham/nginx.nix index 2048ff21..e166b2a4 100644 --- a/makefu/2configs/home/ham/nginx.nix +++ b/makefu/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