1. The problem I’m having:
I’d like a general review of my Caddy file – any comments on structure, unnecessary stuff, etc.
I also have these two questions:
- Is there a way to suppress output to the shell, at least after initial config/startup?
- Is there a better way to apply global header params than using a function in each subdomain?
2. Error messages and/or full log output:
n/a
3. Caddy version:
2.6.4
4. How I installed and ran Caddy:
a. System environment:
Win10 Pro x64
b. Command:
caddy run
d. My complete Caddy config:
{
email myemail@email.net
default_sni justinsdomain.com
servers :8443 {
protocols h2 h1
}
#log stdout
log caddy-log {
output file caddy.log
}
}
(headers) {
header {
Strict-Transport-Security "max-age=31536000; includeSubDomains;"
X-Xss-Protection "1; mode=block"
X-Content-Type-Options "nosniff"
X-Frame-Options "SAMEORIGIN"
Content-Security-Policy "upgrade-insecure-requests"
Referrer-Policy "strict-origin-when-cross-origin"
Cache-Control "public, max-age=15, must-revalidate"
}
}
(logging) {
log {
output file "{args.0}.log"
}
}
#file server 1
serv1.justinsdomain.com:8443 {
log {
output file caddy-Serv1.log
}
reverse_proxy :8080
encode zstd gzip
import headers
}
#file server 2
serv2.justinsdomain.com:8443 {
import logging Serv2
reverse_proxy :8081
encode zstd gzip
import headers
}