summaryrefslogtreecommitdiffstats
path: root/makefu/2configs/home/ham/nginx.nix
blob: cd99c07393f7cfeadd3e2bb8a55327fb654c7f45 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
let
  internal-ip = "192.168.111.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;
      }
    '';
  };
}