diff options
author | Vincent Ambo <mail@tazj.in> | 2022-02-17T15·34+0300 |
---|---|---|
committer | clbot <clbot@tvl.fyi> | 2022-02-18T08·15+0000 |
commit | b936843bb0464d95d0afbfbf7b9656d80a7464a7 (patch) | |
tree | 38646799f9b74638730b44db3dd621cd82082f45 /ops/modules | |
parent | f4f1d97052199143660508e0cf56aa3aef8e02d9 (diff) |
feat(ops/modules): Redirect machine base names to their config r/3843
With this change, entering just "whitby.tvl.fyi" or "sanduny.tvl.su" in a browser will redirect users to their machine configurations. Change-Id: Ibf076a469bcce073e1b1970aa568d6fe16a5c75a Reviewed-on: https://cl.tvl.fyi/c/depot/+/5304 Tested-by: BuildkiteCI Reviewed-by: sterni <sternenseemann@systemli.org> Autosubmit: tazjin <tazjin@tvl.su>
Diffstat (limited to 'ops/modules')
-rw-r--r-- | ops/modules/www/sanduny.tvl.su.nix | 16 | ||||
-rw-r--r-- | ops/modules/www/whitby.tvl.fyi.nix | 17 |
2 files changed, 33 insertions, 0 deletions
diff --git a/ops/modules/www/sanduny.tvl.su.nix b/ops/modules/www/sanduny.tvl.su.nix new file mode 100644 index 000000000000..1a60d06fa062 --- /dev/null +++ b/ops/modules/www/sanduny.tvl.su.nix @@ -0,0 +1,16 @@ +# Redirect sanduny.tvl.su to the machine configuration. + +{ + imports = [ + ./base.nix + ]; + + config.services.nginx.virtualHosts."sanduny.tvl.su" = { + serverName = "sanduny.tvl.su"; + enableACME = true; + + extraConfig = '' + return 302 https://at.tvl.fyi/?q=%2F%2Fops%2Fmachines%2Fsanduny; + ''; + }; +} diff --git a/ops/modules/www/whitby.tvl.fyi.nix b/ops/modules/www/whitby.tvl.fyi.nix new file mode 100644 index 000000000000..bcd7a76ec4e8 --- /dev/null +++ b/ops/modules/www/whitby.tvl.fyi.nix @@ -0,0 +1,17 @@ +# Redirect whitby.tvl.fyi to the machine configuration. + +{ + imports = [ + ./base.nix + ]; + + config.services.nginx.virtualHosts."whitby.tvl.fyi" = { + serverName = "whitby.tvl.fyi"; + serverAliases = [ "whitby.tvl.su" ]; + enableACME = true; + + extraConfig = '' + return 302 https://at.tvl.fyi/?q=%2F%2Fops%2Fmachines%2Fwhitby; + ''; + }; +} |