Skip to content

Commit

Permalink
feat: update nginx config
Browse files Browse the repository at this point in the history
  • Loading branch information
sioodmy committed May 4, 2024
1 parent 183879b commit 5300a80
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions system/server/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,12 @@
root = inputs.website.packages.${pkgs.system}.website;
enableACME = true;
locations."/" = {
tryFiles = "$uri $uri.html $uri/ =404";
tryFiles = "$uri/index.html $uri.html $uri/ $uri =404";
extraConfig = ''
if ($request_uri ~ ^/(.*)\.html$) {
return 302 /$1;
}
rewrite ^(/.*)\.html(\?.*)?$ $1$2 permanent;
rewrite ^/(.*)/$ /$1 permanent;
error_page 404 /404.html;
'';
};

Expand Down

0 comments on commit 5300a80

Please sign in to comment.