1. The problem I’m having:
Will there be a difference in logging if the log
directive comes first or last in a Caddyfile? I changed the order in a config for one of our servers but can’t really tell if there is a difference.
I’ve always used Caddy with the impression it doesn’t matter, but a few investigations made be doubt my knowledge…
2. Error messages and/or full log output:
Not relevant
3. Caddy version:
2.7.6
4. How I installed and ran Caddy:
Not relevant, this is a general config question
Caddy config:
Let’s say I have a Caddyfile with two handle_path
directives. Will there be a difference with these two configs?
Example 1:
my.lovely.domain.com {
log
tls hello@lovely.domain.com
encode zstd, gzip
handle_path /cdn/* {
root * /var/caddy/cdn
file_server
}
handle_path /frontend/* {
root * /var/caddy/frontend
file_server
}
respond "nothing here for you"
}
Example 2:
my.lovely.domain.com {
tls hello@lovely.domain.com
encode zstd, gzip
handle_path /cdn/* {
root * /var/caddy/cdn
file_server
}
handle_path /frontend/* {
root * /var/caddy/frontend
file_server
}
respond "nothing here for you"
log
}
Is this a case of “Order doesn’t matter”?
Or am I fooled and missed a lot of successful requests?