I’m looking into migrating a nginx server with several subdomains to caddy.
Most of my current setup is simple enough to do this in a straightforward manner, but I’m a bit stuck on the log directive.
As far as I understand it is possible to use multiple log entries per vhost, at least I found a resolved issue regarding that exact problem. What I don’t know is if it is possible to have several log directives pointing to the same logfile.
My intention is something similar to:
sub1.example.com {
root /srv/www/sub1site/
log /var/log/caddy/sub1/access.log
log /var/log/caddy/everything.log
errors /var/log/caddy/sub1/errors.log
errors /var/log/caddy/allerrors.log
}
sub2.example.com {
root /srv/www/sub2site/
log /var/log/caddy/sub2/access.log
log /var/log/caddy/everything.log
errors /var/log/caddy/sub2/errors.log
errors /var/log/caddy/allerrors.log
}
This brings up several questions:
- Is this permissible?
- Will the vhosts step on each other’s toes while trying to write to the log?
- How would I handle rotation of the central log?