From 073142f796bbc1e9a403e426d190d6a6f4156f49 Mon Sep 17 00:00:00 2001 From: Ryan Lahfa Date: Mon, 17 Mar 2025 13:01:57 +0100 Subject: [PATCH] feat(ops/www/gerrit): backward compatibility to TVL shortlinks MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit cl.snix.fyi/q/$ID where $ID ≤ 30K will redirect (301) to cl.tvl.fyi/q/$ID to keep the old links working. Change-Id: I27b496a1c52a3de3d106292ba7a2931b0f15fa49 Signed-off-by: Ryan Lahfa --- ops/modules/www/cl.snix.dev.nix | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/ops/modules/www/cl.snix.dev.nix b/ops/modules/www/cl.snix.dev.nix index de71dd3c6..198b4eaa6 100644 --- a/ops/modules/www/cl.snix.dev.nix +++ b/ops/modules/www/cl.snix.dev.nix @@ -24,6 +24,11 @@ proxy_set_header Host $host:443; } + # Retro-compatibility to TVL shortlinks. + location ~ "^/q/([1-2]?[0-9]{1,4}|30000)$" { + return 302 https://cl.tvl.fyi$request_uri; + } + location = /robots.txt { return 200 'User-agent: *\nAllow: /'; }