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