bert: Serve swiftgang.net on www instead

This commit is contained in:
Chandler Swift 2024-11-25 23:15:07 -06:00
parent ee47eb1ed2
commit 898a98ef1e
Signed by: chandlerswift
GPG key ID: A851D929D52FB93F
2 changed files with 29 additions and 1 deletions

View file

@ -23,5 +23,30 @@
metrics # Enable Prometheus monitoring metrics # Enable Prometheus monitoring
} }
''; '';
virtualHosts.":80" = {
serverAliases = [":443"];
extraConfig = ''
respond <<EOF
<!DOCTYPE html>
<html>
<head>
<title>not found - chandlerswift.com</title>
<style>
body {
width: 35em;
margin: 0 auto;
font-family: Tahoma, Verdana, Arial, sans-serif;
}
</style>
</head>
<body>
<h1>not found - chandlerswift.com</h1>
<p>This page is hosted with <a href="https://chandlerswift.com/">chandlerswift.com</a>,
but the site couldn't be found.</p>
</body>
</html>
EOF 404
'';
};
}; };
} }

View file

@ -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 encode zstd gzip
file_server file_server
root * /srv/www/swiftgang.net root * /srv/www/swiftgang.net