diff --git a/hosts/www/nginx.nix b/hosts/www/nginx.nix index c84f18c..f957fdd 100644 --- a/hosts/www/nginx.nix +++ b/hosts/www/nginx.nix @@ -78,7 +78,7 @@ in ''; }; "/all.ics" = { - return = "301 https://www.berlin.ccc.de/calendars/all.ics"; + return = "301 https://www.${config.networking.domain}/calendars/all.ics"; }; "~ ^/calendars/([^/]+\.ics)$" = { alias = "/srv/http/calendars/$1"; @@ -97,11 +97,26 @@ in kTLS = true; forceSSL = true; enableACME = true; - locations."/" = { - basicAuthFile = config.age.secrets.www-staging-htpasswd.path; - root = "/srv/http/www-staging"; - index = "index.html"; - tryFiles = "$uri $uri/ $uri.html =404"; + locations = { + "/" = { + basicAuthFile = config.age.secrets.www-staging-htpasswd.path; + root = "/srv/http/www-staging"; + index = "index.html"; + tryFiles = "$uri $uri/ $uri.html =404"; + }; + "/all.ics" = { + return = "301 https://staging.${config.networking.domain}/calendars/all.ics"; + }; + "~ ^/calendars/([^/]+\.ics)$" = { + alias = "/srv/http/calendars/$1"; + extraConfig = '' + add_header Cache-Control "no-cache"; + types { + text/calendar ics; + } + default_type text/calendar; + ''; + }; }; }; };