diff options
author | Ethel Morgan <eth@ethulhu.co.uk> | 2020-07-11 13:52:04 +0100 |
---|---|---|
committer | Ethel Morgan <eth@ethulhu.co.uk> | 2020-07-11 13:52:04 +0100 |
commit | b62307bf39fcb476bad015bd7ec34e7e2c04e9e4 (patch) | |
tree | d4c3e9274bef20d9c9b8ed13d7cd268b41bdb1cd | |
parent | d9912da7df0b22806cdf8fbe684a67c5a52914fd (diff) |
add try_files to sites.static
Diffstat (limited to '')
-rw-r--r-- | nixos/sites/default.nix | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/nixos/sites/default.nix b/nixos/sites/default.nix index 95d8055..032803e 100644 --- a/nixos/sites/default.nix +++ b/nixos/sites/default.nix @@ -12,6 +12,15 @@ locations = { "/" = { root = root; + extraConfig = '' + if ($request_uri ~ ^/(.*)\.html$) { + return 302 /$1; + } + if ($request_uri ~ ^/(.*)/$) { + return 302 /$1; + } + try_files $uri $uri.$extension $uri/ =404; + ''; }; }; }; |