Choose the HTTP security headers your site should send and copy a ready-made configuration for Apache, Nginx, Netlify, Cloudflare Pages, a Cloudflare Worker, Vercel, Express or IIS. Presets get you started, and warnings explain what each setting might break.
Last updated:
Start from:
Headers (0)
Advertisement
Advertisement
How to use the Security Headers Generator
Pick a preset (Basic, Recommended or Strict) or start toggling headers yourself.
Adjust each header: HSTS duration, frame policy, referrer policy, permissions and isolation options.
Read the warnings on the right; they flag settings that can break embeds, pop-ups or subdomains.
Choose your server from the tabs: Apache, Nginx, Netlify, Cloudflare, Vercel, Express or IIS.
Copy or download the config, deploy it, and verify the live headers with the HTTP Header Parser.
What each header does
Header
Typical value
Risk of breaking things
Strict-Transport-Security
max-age=31536000; includeSubDomains
Low, if all subdomains have HTTPS
X-Content-Type-Options
nosniff
Very low; files must have correct Content-Type
X-Frame-Options
SAMEORIGIN
Low; blocks other sites from embedding yours
Referrer-Policy
strict-origin-when-cross-origin
Very low; analytics still see the referring site
Permissions-Policy
camera=(), microphone=(), geolocation=()
Low, if you only disable unused features
Cross-Origin-Opener-Policy
same-origin
Medium; can break OAuth and payment pop-ups
Cross-Origin-Resource-Policy
same-site
Medium; other sites cannot hotlink your files
Cross-Origin-Embedder-Policy
credentialless or require-corp
High; third-party embeds must opt in
Content-Security-Policy
Site-specific
High until tuned; start in Report-Only mode
A safe rollout plan
Start with the low-risk headers: nosniff, a frame policy, a Referrer-Policy and HSTS with a short max-age such as one day.
Add a CSP in Report-Only mode and watch the browser console for violations for a week. Write the policy with the Content Security Policy Generator.
Raise HSTS to one year with includeSubDomains once every subdomain serves HTTPS correctly.
Enforce the CSP and add Permissions-Policy and COOP, testing logins, payments and embedded media.
At a minimum: Strict-Transport-Security (on HTTPS sites), X-Content-Type-Options: nosniff, a frame policy (X-Frame-Options or CSP frame-ancestors) and a Referrer-Policy. A Content-Security-Policy and Permissions-Policy add strong protection on top. The Recommended preset sets all of these with values that rarely break sites.
Is HSTS preload safe to enable?
Only when every subdomain works over HTTPS, now and in the future. After you submit the domain at hstspreload.org, browsers ship it in their built-in list and will refuse HTTP connections for the domain and all subdomains. Removal takes months, so start with a short max-age, then use one year with includeSubDomains, and add preload last.
Should I use X-Frame-Options or CSP frame-ancestors?
CSP frame-ancestors is the modern standard and supports lists of allowed sites; when both are present, current browsers follow frame-ancestors. X-Frame-Options (DENY or SAMEORIGIN) still helps very old browsers, so sending both with matching values is a common choice. The ALLOW-FROM value of X-Frame-Options is no longer supported.
Why is X-XSS-Protection set to 0?
The browser XSS filter it controlled has been removed from Chrome, Edge and Safari, and in older browsers it could be abused to leak data from pages. OWASP and browser vendors recommend disabling it with 0 (or not sending it) and relying on a Content-Security-Policy instead.
What do COOP and COEP do?
Cross-Origin-Opener-Policy: same-origin separates your window from cross-origin pages that open it or that it opens, blocking cross-window attacks. Cross-Origin-Embedder-Policy requires every embedded resource to allow being loaded. Together they make a page cross-origin isolated, which is needed for SharedArrayBuffer, but COEP can break third-party images, videos and widgets.
Why don't my Nginx headers appear on some pages?
Nginx only inherits add_header directives from the server block when a location block has none of its own. If a location adds any header, repeat the security headers there or put them in an include file used in every location. Also use the always parameter so headers are sent on error pages.
How do I check that the headers work?
Deploy the configuration, then load your site with browser DevTools (Network tab) or run curl -I https://yourdomain and paste the response into the HTTP Header Parser. It explains each header and grades the result.
Are all the tools on FreeToolCabin tested for quality and accuracy?
Yes! Every tool on our site undergoes automated Q/A testing in real browser environments to ensure high precision, correct output, and zero errors. If you happen to spot a bug or have a suggestion, please contact us at [email protected] and our team will review it right away.