Omnikit
DevFilesMoneyAll tools
Ctrl K
Dev toolsFile toolsMoney calculatorsAll tools
HomeDeveloper toolsSecurity Headers Generator

Security Headers Generator

dev

Choose HSTS, CSP, framing and more, then copy the nginx, Apache or Vercel config

Runs in your browser. Nothing you type is sent anywhere. Checked against sources on 17 Oct 2026.

Security headers are HTTP response headers that tell the browser to use HTTPS, block framing, stop type sniffing and limit features. This generator writes up to 11 of them, from OWASP's recommended set or a gentler profile, as ready configuration for nginx, Apache, Caddy, IIS, Netlify, Vercel or Express.

Next:
  • CSP Evaluator Check a Content-Security-Policy directive by directive and see how scripts get past it
  • HTTP Headers Checker See the status, response headers and redirect chain of any URL, with security checks

How to add security headers to a website

1

Start from a profile: Strict follows OWASP, Balanced suits most sites, Basic changes the least.

2

Adjust HSTS, framing, Referrer-Policy, Permissions-Policy and the cross-origin headers.

3

Pick your server: nginx, Apache, Caddy, IIS, Netlify, Vercel or Express.

4

Copy the snippet into the configuration, reload, and check the live site with the HTTP headers checker.

About Security Headers Generator

A web server sends none of the protective headers unless it is told to. Each one closes a specific hole, and getting the syntax right for every server is the slow part. Choose the headers once and copy the snippet for yours.

Profiles. Strict is exactly the OWASP Secure Headers Project's recommended set, checked against its published list. Balanced keeps the parts that rarely break a site. Basic changes the least.

Header Strict Balanced
Strict-Transport-Security 2 years, subdomains 1 year, subdomains
Content-Security-Policy OWASP starter allows https images
X-Frame-Options DENY SAMEORIGIN
Referrer-Policy no-referrer strict-origin-when-cross-origin
Permissions-Policy 29 features off 6 features off
Cross-Origin-Embedder-Policy require-corp not sent

HSTS. Browsers remember to use HTTPS for max-age seconds. The preload list accepts a domain only with at least 31536000 seconds, includeSubDomains and preload, and the page warns when one is missing. Start short, because a mistake is cached for the whole period.

Framing and CSP. The X-Frame-Options choice also writes the matching CSP frame-ancestors, so the old and new header never disagree. The CSP here is a starting point; check yours line by line with the CSP evaluator before you enforce it, or send it as report-only first.

Cross-origin headers. Cross-Origin-Embedder-Policy: require-corp blocks any image, script or frame from another site that does not opt in, so it is off in Balanced.

Server quirks. nginx adds headers only on success codes unless always is given, and a location with its own add_header forgets the ones above it; Apache needs mod_headers. The notes under each snippet say where it goes. Afterwards, test the live site with the HTTP headers checker. Nothing you type leaves the browser.

Frequently asked questions

Which security headers should a website send?

At least Strict-Transport-Security, Content-Security-Policy, X-Content-Type-Options: nosniff, a framing rule (X-Frame-Options or CSP frame-ancestors) and Referrer-Policy. Permissions-Policy and the cross-origin headers add more protection. The OWASP Secure Headers Project lists 13 recommended headers, and the Strict profile here follows it.

How do I add security headers in nginx?

Add one add_header line per header inside the server block, with the always flag so error pages and redirects get them too, then run nginx -t and reload. Any location block with its own add_header loses every header set above it, so repeat the lines there or use an include file.

What does the HSTS preload list require?

A valid certificate, a redirect from HTTP to HTTPS on the same host, HTTPS on every subdomain, and a Strict-Transport-Security header on the base domain with max-age of at least 31536000 seconds, includeSubDomains and preload. Removal from the list takes months, so only submit when every subdomain is ready.

Does Cross-Origin-Embedder-Policy break images?

With require-corp, the browser refuses any image, script, font or frame from another origin unless that response sends Cross-Origin-Resource-Policy or allows CORS. Third-party embeds and CDN images often fail. Use it only when you need cross-origin isolation, for example for SharedArrayBuffer, and test first.

Is X-Frame-Options still needed with CSP frame-ancestors?

Modern browsers obey frame-ancestors and ignore X-Frame-Options when both are present, but older browsers know only X-Frame-Options. Sending both costs nothing; the generator keeps them consistent, so DENY pairs with frame-ancestors 'none' and SAMEORIGIN with frame-ancestors 'self'.

Should I send X-XSS-Protection?

No. Current browsers have removed the XSS auditor, and in older ones the filter itself could be abused to leak data; OWASP's recommended set leaves it out. A Content-Security-Policy without unsafe-inline scripts is the protection that replaces it.

Sources

  • OWASP Secure Headers ProjectRecommended values (ci/headers_add.json, updated 4 Oct 2026) and headers to remove
  • RFC 6797, HTTP Strict Transport Securitymax-age and includeSubDomains syntax
  • HSTS Preload List Submissionmax-age of at least 31536000, includeSubDomains and preload
  • W3C Permissions PolicyStructured Field Dictionary, feature=() and (self)
  • nginx ngx_http_headers_moduleadd_header ... always and its inheritance rule
  • Apache mod_headersHeader always set

Last verified 17 October 2026.

Rates and rules change; check the source before you rely on a figure.

Still stuck? Ask about Security Headers Generator and anybody who knows can answer. No account needed.

Common uses

  • Nginx Security Headers GeneratorWrite the add_header lines that give an nginx site HSTS, CSP and other security headers
  • HSTS Header GeneratorBuild a Strict-Transport-Security header and check it against the preload list rules

On the related tools: JWT Decoder – Paste a token to read its header, payload and expiry · Passphrase Generator – Three to ten random words you can actually remember · Bcrypt Generator – Generate a bcrypt hash for a test user or a config file.

Related tools

All developer tools
JWT Decoder, Verifier & EncoderDecode any JWT, verify its signature, and sign new tokens, all in your browserPassword GeneratorStrong random passwords and memorable passphrases, generated on your devicePassword Strength CheckerHow long your password would survive an attack, and exactly what makes it weakHMAC GeneratorHMAC-SHA1, SHA-256, SHA-384 and SHA-512 of text or a file, and signature checksBcrypt Hash and VerifyHash a password with bcrypt at cost 4 to 14, or check a password against a hashTOTP Generator and TesterLive authenticator codes from a secret, a QR code for your app, and a code testerCertificate DecoderRead an SSL certificate, CSR or public key: names, dates, key size and fingerprintsIMEI CheckerCheck an IMEI number’s check digit, see its TAC and serial, and look up the phone model
Was this tool helpful?
Omnikit

Small jobs, done in your browser. Free, fast and private. Files are never uploaded.

Files

  • Compress Image
  • Image to PDF
  • Merge PDF
  • Compress PDF
  • PDF to Word
  • Word to PDF

Dev

  • JSON Formatter & Validator
  • Base64 Encode & Decode
  • JWT Decoder, Verifier & Encoder
  • Password Generator
  • UUID Generator
  • Unix Timestamp Converter

Money

  • SIP Calculator
  • EMI Calculator
  • GST Calculator
  • FD Calculator
  • PPF Calculator
  • Lumpsum Calculator
GuidesQuestionsAboutHow we checkLaw library (beta)PrivacyTermsDisclosureContactMore: Exam practice (UGC NET Paper 1)Runs in your browser. Nothing is uploaded. © 2026 Omnikit (theomnikit.com)