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.
Recommended baseline
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.