diff --git a/hosts/luna/modules/services/nginx.nix b/hosts/luna/modules/services/nginx.nix index 651b8b84..624b4c82 100644 --- a/hosts/luna/modules/services/nginx.nix +++ b/hosts/luna/modules/services/nginx.nix @@ -22,6 +22,12 @@ forceSSL = true; enableACME = true; root = inputs.blog.packages.${pkgs.system}.default; + locations."/".extraConfig = '' + if ($request_uri ~ ^/(.*)\.html(\?|$)) { + return 302 /$1; + } + try_files $uri $uri.html $uri/ =404; + ''; locations."/".index = "home.html"; }; }