diff --git a/hosts/containers/freifunk/configuration.nix b/hosts/containers/freifunk/configuration.nix index de62047e..3f4f0e54 100644 --- a/hosts/containers/freifunk/configuration.nix +++ b/hosts/containers/freifunk/configuration.nix @@ -226,48 +226,34 @@ in { "c3d2.ffdd" = { default = true; root = ; - locations = { - "/" = { - index = "index.html"; - extraConfig = '' - etag off; - add_header etag "\"${builtins.substring 11 32 ( + "/assets")}\""; - ''; - }; - "=/sysinfo-json.cgi" = { - alias = "/tmp/sysinfo.json"; - extraConfig = '' - add_header Content-Type "application/json;charset=UTF-8"; - ''; - }; - "=/sysinfo.json" = { - alias = "/tmp/sysinfo.json"; - extraConfig = '' - add_header Content-Type "application/json;charset=UTF-8"; - ''; - }; - }; - }; - "storage.hq.c3d2.ffdd" = { - locations = { - "/".proxyPass = "http://storage.hq.c3d2.de/"; - }; - }; - "grafana.hq.c3d2.ffdd" = { - locations = { - "/" = { - proxyPass = "https://grafana.hq.c3d2.de/"; - extraConfig = '' - proxy_ssl_server_name on; + locations = + let + sysinfo-json = { + alias = "/tmp/sysinfo.json"; + extraConfig = '' + add_header Content-Type "application/json;charset=UTF-8"; ''; + }; + in { + "/" = { + index = "index.html"; + extraConfig = '' + etag off; + add_header etag "\"${builtins.substring 11 32 ( + "/assets")}\""; + ''; + }; + "=/sysinfo-json.cgi" = sysinfo-json; + "=/sysinfo.json" = sysinfo-json; }; - }; }; - "influxdb.hq.c3d2.ffdd" = { - locations = { - "/".proxyPass = "http://grafana.hq.c3d2.de:8086/"; - }; + "storage.hq.c3d2.ffdd".locations."/".proxyPass = "http://storage.hq.c3d2.de/"; + "grafana.hq.c3d2.ffdd".locations."/" = { + proxyPass = "https://grafana.hq.c3d2.de/"; + extraConfig = '' + proxy_ssl_server_name on; + ''; }; + "influxdb.hq.c3d2.ffdd".locations."/".proxyPass = "http://grafana.hq.c3d2.de:8086/"; }; };