HTTP Security Headers Reference

HSTS, CSP, X-Frame-Options and every security header with recommended values

Searchable offline reference for HTTP security response headers — HSTS, CSP, X-Frame-Options, X-Content-Type-Options, Referrer-Policy, Permissions-Policy and more — with recommended values, OWASP guidance and browser support notes.

What is the recommended HSTS header value?

A strong baseline is Strict-Transport-Security with max-age=63072000 (two years), includeSubDomains and preload. The long max-age and preload directive let browsers refuse plaintext HTTP before the first request, but only add preload once every subdomain serves HTTPS.

HTTP security headers are response headers that instruct the browser to enable built-in defences against common web attacks: protocol downgrade, cross-site scripting, clickjacking, MIME sniffing and information leakage. Setting them correctly is one of the cheapest, highest-leverage hardening steps for any site.

How it works

Each header is sent by your server or CDN on every HTTP response. The browser reads the header value and adjusts its behaviour — for example, Strict-Transport-Security makes the browser remember to use HTTPS, and X-Content-Type-Options: nosniff stops it from guessing a resource’s content type. This reference lists the practical security headers, the value you should ship in production, and the specific attack each one mitigates. Search by name or by keyword such as clickjacking, mime, or https.

A solid hardened set looks like this — adapt the CSP allow-list to your assets:

Strict-Transport-Security: max-age=63072000; includeSubDomains; preload
Content-Security-Policy: default-src 'self'; object-src 'none'; frame-ancestors 'none'
X-Content-Type-Options: nosniff
Referrer-Policy: strict-origin-when-cross-origin
Permissions-Policy: geolocation=(), camera=(), microphone=()
X-Frame-Options: DENY

Notes and tips

Deploy Content-Security-Policy in report-only mode first to avoid breaking legitimate resources. The Permissions-Policy syntax uses an allow-list of origins per feature, where an empty list () disables the feature for everyone. Avoid the deprecated X-XSS-Protection (set it to 0) and Public-Key-Pins (removed from browsers). Always validate header casing is irrelevant but the directive values are case-sensitive for tokens like nosniff and DENY.