From 83a61385410d9c3833d44011df376d0661f5ae1a Mon Sep 17 00:00:00 2001 From: Chandler Swift Date: Mon, 25 Nov 2024 23:15:07 -0600 Subject: [PATCH] Serve swiftgang.net on www instead --- bert/services/http/index.nix | 25 +++++++++++++++++++++++++ bert/services/http/swiftgang.net.nix | 5 ++++- 2 files changed, 29 insertions(+), 1 deletion(-) diff --git a/bert/services/http/index.nix b/bert/services/http/index.nix index c358bb0..07342bc 100644 --- a/bert/services/http/index.nix +++ b/bert/services/http/index.nix @@ -23,5 +23,30 @@ metrics # Enable Prometheus monitoring } ''; + virtualHosts.":80" = { + serverAliases = [":443"]; + extraConfig = '' + respond < + + + not found - chandlerswift.com + + + +

not found - chandlerswift.com

+

This page is hosted with chandlerswift.com, + but the site couldn't be found.

+ + + EOF 404 + ''; + }; }; } diff --git a/bert/services/http/swiftgang.net.nix b/bert/services/http/swiftgang.net.nix index 1de094e..7ae5ec7 100644 --- a/bert/services/http/swiftgang.net.nix +++ b/bert/services/http/swiftgang.net.nix @@ -1,6 +1,9 @@ { - services.caddy.virtualHosts."swiftgang.net".extraConfig = '' + # GoDaddy can't do flattening to apply a CNAME to an apex record. So we use + # their "forwarding" (redirect-as-a-service) to redirect to www.…, which we + # _can_ CNAME. + services.caddy.virtualHosts."www.swiftgang.net".extraConfig = '' encode zstd gzip file_server root * /srv/www/swiftgang.net