webzod
account

Decide whether to add includeSubDomains on Caddy

tls.hsts.no_include_subdomains · effort: a project

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

  1. Edit the header line as in the generic steps and reload Caddy.
  2. 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.

Read the documentation (opens in a new tab)

Scan your domain to see whether this applies to you.