about summary refs log tree commit diff
path: root/ops
diff options
context:
space:
mode:
Diffstat (limited to 'ops')
-rw-r--r--ops/nixos/www/b.tvl.fyi.nix10
-rw-r--r--ops/nixos/www/cl.tvl.fyi.nix5
2 files changed, 15 insertions, 0 deletions
diff --git a/ops/nixos/www/b.tvl.fyi.nix b/ops/nixos/www/b.tvl.fyi.nix
index 9bbdcd22aed6..45f6c6ed5141 100644
--- a/ops/nixos/www/b.tvl.fyi.nix
+++ b/ops/nixos/www/b.tvl.fyi.nix
@@ -6,6 +6,11 @@
   ];
 
   config = {
+    services.nginx.virtualHosts."b-shortlink" = {
+      serverName = "b";
+      extraConfig = "return 302 https://b.tvl.fyi$request_uri;";
+    };
+
     services.nginx.virtualHosts."b.tvl.fyi" = {
       serverName = "b.tvl.fyi";
       serverAliases = [ "b.tvl.su" ];
@@ -13,6 +18,11 @@
       forceSSL = true;
 
       extraConfig = ''
+        # Forward short links to issues to the issue itself (b/32)
+        location ~ ^/(\d+)$ {
+          return 302 https://b.tvl.fyi/issues$request_uri;
+        }
+
         location / {
           proxy_pass http://localhost:${toString config.services.depot.panettone.port};
         }
diff --git a/ops/nixos/www/cl.tvl.fyi.nix b/ops/nixos/www/cl.tvl.fyi.nix
index d0aac1b0980f..470122c395ea 100644
--- a/ops/nixos/www/cl.tvl.fyi.nix
+++ b/ops/nixos/www/cl.tvl.fyi.nix
@@ -6,6 +6,11 @@
   ];
 
   config = {
+    services.nginx.virtualHosts."cl-shortlink" = {
+      serverName = "cl";
+      extraConfig = "return 302 https://cl.tvl.fyi$request_uri;";
+    };
+
     services.nginx.virtualHosts.gerrit = {
       serverName = "cl.tvl.fyi";
       serverAliases = [ "cl.tvl.su" ];