Fix · nginx
Fix “HTTP Strict Transport Security (HSTS)” on nginx
Add: Strict-Transport-Security: max-age=63072000; includeSubDomains; preload
add_header Strict-Transport-Security "max-age=63072000; includeSubDomains; preload" always;
Verify the fix
Re-run the HTTP Strict Transport Security (HSTS) check after deploying. Test config changes in staging first and keep a rollback: a wrong header can break a site faster than a missing one.
Other stacks: Apache · Caddy · Express / Node · Cloudflare