In one sentence
The builder produces a recommended set of HTTP security headers (HSTS per RFC 6797, a deny-by-default Content-Security-Policy starter, X-Content-Type-Options nosniff, Referrer-Policy and optional Permissions-Policy and X-Frame-Options) and formats them for nginx, Apache httpd, IIS web.config, Jetty rewrite rules or a static host's _headers file, with warnings for unsafe HSTS preload settings.
How do I use the Header Builder?
Pick your options, choose your server tab, copy the configuration and test it.
- Set HSTS: max-age, includeSubDomains, preload.
- Configure the CSP starter: add the script, API and image hosts your site needs, and keep Report-Only on at first.
- Choose the other headers.
- Pick nginx, Apache, IIS, Jetty, a static host or raw output.
- Deploy to a test environment, check the browser console for CSP reports, then enforce.
What does each header do?
| Header | Effect |
|---|---|
Strict-Transport-Security |
Browser uses only HTTPS for this host for max-age seconds |
Content-Security-Policy |
Allowlists sources for scripts, styles, images, frames and connections |
X-Content-Type-Options: nosniff |
Stops MIME type sniffing |
Referrer-Policy |
Limits how much of the URL is sent to other sites (protects codes and tokens in URLs) |
Permissions-Policy |
Disables powerful features such as camera and geolocation |
X-Frame-Options |
Legacy clickjacking protection |
Where do server-specific details matter?
In inheritance and quoting rules.
- nginx:
add_headerin alocationblock replaces server-level headers; usealwaysso headers are also sent on error responses. - Apache: requires
mod_headers; useHeader always set. - IIS: custom headers in
web.config; IIS 10 version 1709 and later also has native per-site HSTS settings. - Jetty: rewrite module rules; for PingFederate, use its response header configuration files. See HSTS on Jetty-based servers.
- Static hosts: a
_headersfile at the site root on hosts that support it.
Is anything sent to a server?
No. The configuration is generated in your browser.
Questions
Which HSTS max-age should I use?
Start with a few minutes while testing, then raise it in steps to one year (31536000) or two (63072000). Preload lists require at least one year plus includeSubDomains.
Why start CSP in Report-Only mode?
A strict policy often blocks something you forgot, such as an analytics script or an image host. Report-Only shows violations in the browser console without blocking, so you can adjust before enforcing.
Do I still need X-Frame-Options?
CSP frame-ancestors replaces it in current browsers. Sending X-Frame-Options as well only helps very old browsers; it is optional.
Is X-XSS-Protection included?
No. Modern browsers have removed the XSS auditor that header controlled, and the header can cause problems. Use CSP instead.