vielac.at leads here

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 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NizVpJ2dwzCbjCrTLCjeHn
This commit is contained in:
Claude 2026-10-06 20:41:13 +00:00
parent ff115c1d6b
commit 864d36bfb0
No known key found for this signature in database
2 changed files with 61 additions and 0 deletions

View File

@ -39,6 +39,51 @@ Check propagation (repeat until it prints the server IP):
local$ dig +short git.vienalatina.com 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 | `<SERVER-IP>` | 300 |
| `www` | A | `<SERVER-IP>` | 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 ## 2. First login + basic hardening
```sh ```sh

View File

@ -21,6 +21,22 @@ www.vienalatina.com {
redir https://vienalatina.com{uri} 301 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 { vienalatina.com {
root * /var/www/vienalatina.com root * /var/www/vienalatina.com
encode zstd gzip encode zstd gzip