From 864d36bfb07dca2ef37c105f98810f94e5a00f19 Mon Sep 17 00:00:00 2001 From: Claude Date: Tue, 6 Oct 2026 20:41:13 +0000 Subject: [PATCH] vielac.at leads here MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The second name redirects to vienalatina.com, both spellings in one block beside the www one it copies. 301 rather than 302, so a search engine folds the two names into one site instead of indexing them as duplicates, and {uri} so a link shared to vielac.at/page/agenda/ lands on the agenda rather than on the home page. The runbook gains §1.1: the two A records go in that domain's zone editor — not in Konsole H's nameserver fields, which hand the whole zone to another provider and turn off the editor you want — and they go in *before* Caddy is reloaded, because that is when Let's Encrypt is asked for the certificate. With `caddy validate` before every reload, which is the one command standing between a typo in that file and vienalatina.com going down with it. Co-Authored-By: Claude Opus 5 Claude-Session: https://claude.ai/code/session_01NizVpJ2dwzCbjCrTLCjeHn --- docs/server-setup.md | 45 +++++++++++++++++++++++++++++++++++++++++++ infra/caddy/Caddyfile | 16 +++++++++++++++ 2 files changed, 61 insertions(+) diff --git a/docs/server-setup.md b/docs/server-setup.md index 2f1cbf4..896caf2 100644 --- a/docs/server-setup.md +++ b/docs/server-setup.md @@ -39,6 +39,51 @@ Check propagation (repeat until it prints the server IP): local$ dig +short git.vienalatina.com ``` +### 1.1 A second domain that leads here + +`vielac.at` is the second name, and it redirects: everything that arrives goes +to the same path on vienalatina.com. Two A records in that domain's **zone +editor**, both at the server: + +| Name | Type | Value | TTL | +|---|---|---|---| +| `@` | A | `` | 300 | +| `www` | A | `` | 300 | + +**Not the nameserver page.** On Hetzner's Konsole H those fields hand the whole +zone to another provider's DNS, which is a different thing entirely and turns +off the zone editor you want. *Standard Nameserver eintragen*, save, then edit +the zone. + +Then the block in `infra/caddy/Caddyfile`, which carries both spellings and +answers with a **301** — a permanent redirect is what folds the two names into +one site for a search engine rather than two copies of it, and `{uri}` keeps +the path so a shared link still lands where it was pointing. + +**Order matters, and it is the same order as the cutover above**: the A records +go in first, because Caddy asks Let's Encrypt for the certificate the first time +the name resolves to this server. A reload before DNS has propagated is not +harmful — nothing reaches the block — but it does not get a certificate either, +so reload again afterwards. + +```sh +sudo cp ~/vienalatina/infra/caddy/Caddyfile /etc/caddy/Caddyfile +sudo caddy validate --config /etc/caddy/Caddyfile +sudo systemctl reload caddy +``` + +`validate` before every `reload`, without exception: it is the one command +between a typo in that file and vienalatina.com going down with it. + +```sh +curl -sI https://vielac.at/ | head -3 # 301 → vienalatina.com +curl -sI https://www.vielac.at/page/agenda/ | grep -i location # the path survives +curl -sI https://vienalatina.com/ | head -1 # 200, unchanged +``` + +The third is the one that matters. A Caddyfile edit that breaks the site it was +meant to leave alone is the failure this ordering exists to prevent. + ## 2. First login + basic hardening ```sh diff --git a/infra/caddy/Caddyfile b/infra/caddy/Caddyfile index 5b87d62..62de8b9 100644 --- a/infra/caddy/Caddyfile +++ b/infra/caddy/Caddyfile @@ -21,6 +21,22 @@ www.vienalatina.com { redir https://vienalatina.com{uri} 301 } +# The second name, which leads here rather than somewhere else. +# +# Both spellings in one block, and 301 rather than 302: a permanent redirect is +# what makes a search engine fold the two names into one site instead of +# indexing them as duplicates of each other, and what makes a browser stop +# asking after the first visit. `{uri}` carries the path, so a link somebody +# shared to vielac.at/page/agenda/ lands on the agenda rather than on the home +# page. +# +# Caddy asks Let's Encrypt for this certificate the first time the name +# resolves to this server, so the A records go in before this file is reloaded. +# Until they do, the block is harmless: nothing reaches it. +vielac.at, www.vielac.at { + redir https://vienalatina.com{uri} 301 +} + vienalatina.com { root * /var/www/vienalatina.com encode zstd gzip