From 68d1f834a3db6b3ce1068a24750efa04125c9db9 Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Tue, 30 Nov 2021 13:56:10 +0300 Subject: fix(ops/www): Strip `.html` from TVL blog post URLs Change-Id: I4d1f9284ec004931c07c04d614b01f28eedea508 --- ops/modules/www/tvl.fyi.nix | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/ops/modules/www/tvl.fyi.nix b/ops/modules/www/tvl.fyi.nix index cea29adbe0..cd7c496a90 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; + } ''; }; }; -- cgit 1.4.1