HTTP Security Headers Generator

Add the security headers that protect your visitors: HSTS, anti-framing, MIME sniffing protection, referrer policy and permissions policy. Pick what you need and copy lines ready for htaccess, Nginx or PHP.

Create headers
response headersHTTP/2 200strict-transport-security: max-age=...x-content-type-options: nosniffx-frame-options: SAMEORIGINreferrer-policy: strict-origin...permissions-policy: camera=()HSTS

Generator

How the tool works

Simple steps, all in your browser with no sign-up.

Pick protections

Recommended ones are preselected.

Pick your server

htaccess, Nginx or PHP.

Copy and test

Then test key pages.

What each header does

HeaderJob
Strict-Transport-SecurityStops HTTP access after the first visit
X-Content-Type-OptionsStops browsers running files as another type
X-Frame-OptionsProtects against clickjacking via frames
Referrer-PolicyKeeps internal URLs from leaking
Permissions-PolicyTurns off browser features you do not use
Content-Security-PolicyThe strongest guard against script injection, but needs careful tuning

Before you apply them

  1. Make sure the whole site runs on HTTPS and the certificate is valid before enabling HSTS.
  2. Put the lines in the root htaccess file, or in the site's Nginx config.
  3. Open the site and test key pages: checkout, login and embedded maps.
  4. If your site is shown inside a frame on another site of yours, do not enable X-Frame-Options.

Check your headers from the terminal

CommandWhat it does
curl -sI https://example.comShow all headers
curl -sI https://example.com | grep -i strictConfirm HSTS
apachectl -M | grep headersConfirm mod_headers is enabled in Apache
nginx -t && systemctl reload nginxTest and apply Nginx config

Key terms

Short definitions of what you meet along the way.

HTTP header
An information line the server sends with the page, invisible to visitors.
HSTS
Tells browsers to always open your site over HTTPS.
Clickjacking
Tricking visitors into clicking your site while it is hidden in a frame on another.
CSP
A policy listing allowed sources for scripts and images on your page.

Frequently asked questions

Did not find your answer? Ask us on WhatsApp

Do headers slow my site?

No. They are a few lines sent with each page.

Why no full CSP?

A full CSP differs per site depending on scripts, fonts and analytics. A wrong one can break parts of your site, so we give a safe basic version.

How do I check they work?

Open browser developer tools, the Network tab, pick the page and review Response Headers.

Want a site secured from the start?

Hosting with a free SSL certificate and protection against hacking.

Contact us on WhatsApp