I’ve inherited some infrastructure and as part of this we have a Caddy server.
I’ve gone through the Caddy file and I’m happy with all of the config except for the :443, :80 start of the block.
I assume that :443 and :80 are telling Caddy to listen on port 443 and 80? Or is it that if traffic comes in on either of these ports to use the configuration in the block?
Yep, it tells Caddy to respond with the site defined in that whole block for all requests to port 443 and port 80. If any other sites are defined with specific hostnames on those ports, they will have priority, but if that’s all there is, this is a catch-all. This is explained here in the docs: https://caddyserver.com/docs/http-caddyfile#addresses
Bit of a shame, this config doesn’t benefit from automatic HTTP->HTTPS redirects. Changing the first line to just :443 { would enable redirects, I believe. The tls lines can also be combined:
tls letsencrypt@example.com {
max_certs 100
}
I fixed the formatting of your post, too, to use a code block instead of a quote.