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:
parent
4fb071039b
commit
9d315f81c6
1 changed files with 6 additions and 0 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in a new issue