freifunk: shorten services.nginx.virtualHosts

This commit is contained in:
Astro 2020-04-17 03:18:34 +02:00
parent 6f16c99c38
commit d2f65be2e4
1 changed files with 24 additions and 38 deletions

View File

@ -226,48 +226,34 @@ in {
"c3d2.ffdd" = { "c3d2.ffdd" = {
default = true; default = true;
root = <this-host/assets>; root = <this-host/assets>;
locations = { locations =
"/" = { let
index = "index.html"; sysinfo-json = {
extraConfig = '' alias = "/tmp/sysinfo.json";
etag off; extraConfig = ''
add_header etag "\"${builtins.substring 11 32 (<this-host> + "/assets")}\""; add_header Content-Type "application/json;charset=UTF-8";
'';
};
"=/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;
''; '';
};
in {
"/" = {
index = "index.html";
extraConfig = ''
etag off;
add_header etag "\"${builtins.substring 11 32 (<this-host> + "/assets")}\"";
'';
};
"=/sysinfo-json.cgi" = sysinfo-json;
"=/sysinfo.json" = sysinfo-json;
}; };
};
}; };
"influxdb.hq.c3d2.ffdd" = { "storage.hq.c3d2.ffdd".locations."/".proxyPass = "http://storage.hq.c3d2.de/";
locations = { "grafana.hq.c3d2.ffdd".locations."/" = {
"/".proxyPass = "http://grafana.hq.c3d2.de:8086/"; proxyPass = "https://grafana.hq.c3d2.de/";
}; extraConfig = ''
proxy_ssl_server_name on;
'';
}; };
"influxdb.hq.c3d2.ffdd".locations."/".proxyPass = "http://grafana.hq.c3d2.de:8086/";
}; };
}; };