diff options
author | Vincent Ambo <mail@tazj.in> | 2021-11-30T10·56+0300 |
---|---|---|
committer | Vincent Ambo <mail@tazj.in> | 2021-11-30T10·56+0300 |
commit | 68d1f834a3db6b3ce1068a24750efa04125c9db9 (patch) | |
tree | 3fd3bd65bb67f5afe2178ab7a213ef7024b6702c /ops/modules/www/tvl.fyi.nix | |
parent | e61b50baf97940c53ff536443b4152c5fda79e08 (diff) |
fix(ops/www): Strip `.html` from TVL blog post URLs r/3118
Change-Id: I4d1f9284ec004931c07c04d614b01f28eedea508
Diffstat (limited to 'ops/modules/www/tvl.fyi.nix')
-rw-r--r-- | ops/modules/www/tvl.fyi.nix | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/ops/modules/www/tvl.fyi.nix b/ops/modules/www/tvl.fyi.nix index cea29adbe05f..cd7c496a90e0 100644 --- a/ops/modules/www/tvl.fyi.nix +++ b/ops/modules/www/tvl.fyi.nix @@ -25,6 +25,14 @@ location ~* \.(webp|woff2)$ { add_header Cache-Control "public, max-age=31536000"; } + + location /blog { + if ($request_uri ~ ^/(.*)\.html$) { + return 302 /$1; + } + + try_files $uri $uri.html $uri/ =404; + } ''; }; }; |