Decide whether to add includeSubDomains on Caddy
Why it matters
Without includeSubDomains, subdomains are not forced onto HTTPS by the main domain's policy. Adding it is a choice because it also locks every subdomain, including old or internal ones, to HTTPS.
Risky change. A wrong setting here can take your site or your mail offline. Follow the stages in order, test each one, and keep a way back.
The fix
- Edit the header line as in the generic steps and reload Caddy.
- Stage the change. Start with includeSubDomains at max-age=300, test several subdomains in a browser, and only then raise max-age as in the generic steps.
Caddyfile
example.com { header Strict-Transport-Security "max-age=300; includeSubDomains" }
The examples use example.com. Replace it with your own domain.
Related
Scan your domain to see whether this applies to you.