I have a server running Caddy
that can be reached under the domain rv2680.1blu.de
and marleneschulz.info
. Both DNS A records point to the IP address 178.254.7.175
. I want to make sure Caddy
always redirects the user to https://marleneschulz.info
.
Here is my working Caddyfile
:
www.marleneschulz.info {
redir https://marleneschulz.info
}
https://marleneschulz.info {
root /app/marlene/shared
proxy / django_prod:5000 {
header_upstream Host {host}
header_upstream X-Real-IP {remote}
header_upstream X-Forwarded-Proto {scheme}
except /static
}
log stdout
errors stdout
gzip
}
How can I prevent Caddy
responding with e.g. 404 Site rv2680.1blu.de is not served on this interface
by explicitly defining to redirect every request from rv2680.1blu.de:80
, rv2680.1blu.de:443
, 178.254.7.175:80
, 178.254.7.175:443
and marleneschulz.info
to https://marleneschulz.info
?
I am also a bit confused since the docs state nothing about the www.
prefix.
I want to be as explicit as possible.