This is exactly why the full config was needed. This part of full config is what’s causing the issue:
If you run caddy adapt --pretty
against your Caddyfile, you will see that host name showing in the skip_hosts
list under logging
, which is why its access logs are missing. If you check your logs, you should see this line:
{"level":"warn","ts":1663063402.5579882,"logger":"caddyfile","msg":"Using a path in a site address is deprecated; please use the 'handle' directive instead","address":"http://tls.mk-go.fr/metrics"}
The solution for now is to rewrite your config to:
tls.mk-go.fr {
handle /metrics {
metrics
}
handle {
reverse_proxy p-TLS-2223:80
}
log {
output file /var/log/caddy/tls.mk-go.fr-access.log
}
import common
}
Of course you lose the very benefit you were seeking after, which is excluding visits to /metrics
from logging, but I don’t think that exclusion worked as you expected it anyways.
By the way, do you happen to know what was the Caddy version deployed before this last one?