rom.quark.business {
log /var/log/caddy/rom-quark-business.log {
rotate {
size 5 # Rotate after 5 MB
age 30 # Keep log files for 30 days
keep 2 # Keep at most 2 log files
}
}
header / {
Strict-Transport-Security "max-age=31536000"
X-XSS-Protection "1; mode=block"
X-Content-Type-Options "nosniff"
X-Frame-Options "DENY"
}
tls {
key_type rsa4096
}
root /var/www/html
}
Is it possible to take the header, tls, and even log section out, and make it a global setting (somehow using host variables on the log one), or do I need to repeat the same for each host?
timeouts has a slightly unique behaviour as far as I’m aware; you still declare it inside a server block, but the lowest value amongst all declared servers in a Caddyfile is applied universally. It’s recommended to only apply it once for simplicity.