about summary refs log tree commit diff
path: root/ops/modules/www
diff options
context:
space:
mode:
authorVincent Ambo <mail@tazj.in>2021-05-04T10·55+0200
committertazjin <mail@tazj.in>2021-05-05T09·02+0000
commit7926482f1c3fde91e492d7df569c6bb4b506cc98 (patch)
tree1e3553610cab1e936e16b897c65c01fb6882e4d2 /ops/modules/www
parent47d07e7b5f946ec6b568bba8a3244f6ca58085cc (diff)
feat(ops/www): Configure atward.tvl.fyi and its aliases r/2567
Change-Id: I20dfb057f8184899226bcb4527010a6982d426f0
Reviewed-on: https://cl.tvl.fyi/c/depot/+/3094
Tested-by: BuildkiteCI
Reviewed-by: sterni <sternenseemann@systemli.org>
Diffstat (limited to 'ops/modules/www')
-rw-r--r--ops/modules/www/atward.tvl.fyi.nix33
1 files changed, 33 insertions, 0 deletions
diff --git a/ops/modules/www/atward.tvl.fyi.nix b/ops/modules/www/atward.tvl.fyi.nix
new file mode 100644
index 000000000000..80a2b76064a4
--- /dev/null
+++ b/ops/modules/www/atward.tvl.fyi.nix
@@ -0,0 +1,33 @@
+# Serve atward, the query redirection ... thing.
+{ config, ... }:
+
+{
+  imports = [
+    ./base.nix
+  ];
+
+  config = {
+    # Short link support (i.e. plain http://at) for users with a
+    # configured tvl.fyi/tvl.su search domain.
+    services.nginx.virtualHosts."at-shortlink" = {
+      serverName = "at";
+      extraConfig = "return 302 https://atward.tvl.fyi$request_uri";
+    };
+
+    services.nginx.virtualHosts."atward" = {
+      serverName = "atward.tvl.fyi";
+      enableACME = true;
+      forceSSL = true;
+
+      serverAliases = [
+        "atward.tvl.su"
+        "at.tvl.fyi"
+        "at.tvl.su"
+      ];
+
+      locations."/" = {
+        proxyPass = "http://localhost:${toString config.services.depot.atward.port}";
+      };
+    };
+  };
+}