From 949a8d3d9c34306ca5f9719014db0d7f946a919c Mon Sep 17 00:00:00 2001 From: Jan Kremer Date: Thu, 26 Mar 2026 19:01:09 +0100 Subject: [PATCH] Redirect jankremer.eu to jankremer.de --- modules/nixos/website.nix | 32 +++++++++++++++++++------------- 1 file changed, 19 insertions(+), 13 deletions(-) diff --git a/modules/nixos/website.nix b/modules/nixos/website.nix index 59558a1..e541f15 100644 --- a/modules/nixos/website.nix +++ b/modules/nixos/website.nix @@ -3,22 +3,28 @@ "d /var/www/jankremer.de 755 jan users -" ]; - services.caddy.virtualHosts."jankremer.de".extraConfig = '' - handle { - root * /var/www/jankremer.de - file_server + services.caddy.virtualHosts = { + "jankremer.de".extraConfig = '' + handle { + root * /var/www/jankremer.de + file_server - @static { - path *.css *.js *.woff2 *.woff *.ttf *.png *.jpg *.jpeg *.svg *.ico *.webp - } - header @static Cache-Control "public, max-age=31536000, immutable" + @static { + path *.css *.js *.woff2 *.woff *.ttf *.png *.jpg *.jpeg *.svg *.ico *.webp + } + header @static Cache-Control "public, max-age=31536000, immutable" - @html { - path *.html + @html { + path *.html + } + header @html Cache-Control "no-cache" } - header @html Cache-Control "no-cache" - } - ''; + ''; + + "jankremer.eu".extraConfig = '' + redir https://jankremer.de{uri} permanent + ''; + }; networking.firewall.allowedTCPPorts = [ 80