Caddyfile: redirect old raw-IP URLs to the canonical domain (#16)

Requests to http://<vps-ip>/... were bounced by the default HTTP->HTTPS rule to
https on the bare IP, which has no certificate and fails the TLS handshake, so
pre-domain bookmarks dead-ended with a blank page. Add an http://<ip> site block
that 301-redirects to https://emigriffith.dev, preserving the path.
This commit is contained in:
Emi Griffith 2026-07-10 20:40:08 -07:00 committed by GitHub
parent 4fb071039b
commit 9d315f81c6

View file

@ -35,6 +35,12 @@ emigriffith.dev {
}
}
# Old bookmarks to the raw IP (the pre-domain URL) would otherwise get bounced to
# HTTPS-on-the-IP, which has no cert and fails. Redirect them to the real domain.
http://75.119.132.91 {
redir https://emigriffith.dev{uri} permanent
}
# Optional: redirect www -> apex. Add a www CNAME/A record first, then uncomment.
# www.emigriffith.dev {
# redir https://emigriffith.dev{uri} permanent