about summary refs log tree commit diff
path: root/ops/nixos/www
diff options
context:
space:
mode:
authorLuke Granger-Brown <hg@lukegb.com>2020-07-06T22·18+0000
committerlukegb <lukegb@tvl.fyi>2020-07-06T22·48+0000
commitaae3d25234cea89b69824a6ed8b7994350a32247 (patch)
treefd4628d8cd84f1341f5c7aa7bca4eaddc428321c /ops/nixos/www
parent310302637bf1e6f53117b8a400ffa02567d41cb1 (diff)
feat(ops/nixos/www): create login.tvl.fyi host r/1230
Change-Id: Ifad80915a61a1a5ac14e598a9d788aec3482693c
Reviewed-on: https://cl.tvl.fyi/c/depot/+/936
Tested-by: BuildkiteCI
Reviewed-by: tazjin <mail@tazj.in>
Diffstat (limited to 'ops/nixos/www')
-rw-r--r--ops/nixos/www/base.nix14
-rw-r--r--ops/nixos/www/login.tvl.fyi.nix23
2 files changed, 37 insertions, 0 deletions
diff --git a/ops/nixos/www/base.nix b/ops/nixos/www/base.nix
new file mode 100644
index 000000000000..a15db6bb8a32
--- /dev/null
+++ b/ops/nixos/www/base.nix
@@ -0,0 +1,14 @@
+{ config, ... }:
+
+{
+  config = {
+    services.nginx = {
+      enable = true;
+      enableReload = true;
+
+      recommendedTlsSettings = true;
+      recommendedGzipSettings = true;
+      recommendedProxySettings = true;
+    };
+  };
+}
diff --git a/ops/nixos/www/login.tvl.fyi.nix b/ops/nixos/www/login.tvl.fyi.nix
new file mode 100644
index 000000000000..8513c6e660c5
--- /dev/null
+++ b/ops/nixos/www/login.tvl.fyi.nix
@@ -0,0 +1,23 @@
+{ ... }:
+
+{
+  imports = [
+    ./base.nix
+  ];
+
+  config = {
+    services.nginx.virtualHosts."login.tvl.fyi" = {
+      serverName = "login.tvl.fyi";
+      enableACME = true;
+      forceSSL = true;
+
+      extraConfig = ''
+        location / {
+          proxy_pass http://localhost:8443;
+          proxy_set_header X-Forwarded-For $remote_addr;
+          proxy_set_header Host $host;
+        }
+      '';
+    };
+  };
+}