A practical checklist of every HTTP security header your website should have in 2025 — with implementation examples, score impact, and common mistakes to avoid.

HTTP security headers are one of the most cost-effective investments you can make in your website's security posture. They are a single line of server configuration that can neutralise entire classes of attack — yet surveys consistently show that fewer than 30% of websites have them correctly configured.
This checklist covers every security header that matters in 2025, explains what each one does, shows you how to implement it, and tells you exactly how it affects your Website Intelligence Score™ on SiteReveal.
Modern browsers are powerful allies in the fight against web attacks — but only if you tell them what to do. Security headers are the mechanism by which your server instructs the browser to enforce specific protective behaviours: refuse to load scripts from untrusted origins, never send cookies over HTTP, prevent your pages from being embedded in iframes on malicious sites.
The cost of implementing these headers is measured in minutes. The cost of not having them can be measured in breached user accounts, regulatory fines, and lost customer trust.
What it does: Encrypts all traffic between the browser and your server, preventing eavesdropping and man-in-the-middle attacks.
How to check: Your site URL should begin with https://. In Chrome DevTools → Security, you should see "Connection is secure" with TLS 1.2 or TLS 1.3.
Implementation (Nginx):
ssl_protocols TLSv1.2 TLSv1.3;
ssl_ciphers HIGH:!aNULL:!MD5;
ssl_protocols TLSv1.2 TLSv1.3;
ssl_ciphers HIGH:!aNULL:!MD5;
WIS score impact: HTTPS is a prerequisite. Sites without it receive a Security score of 0 regardless of other headers.
Common mistake: Serving mixed content — loading HTTP resources (images, scripts) on an HTTPS page. This triggers browser warnings and partially negates your HTTPS protection.
What it does: Tells browsers to always use HTTPS for your domain, even if a user types http:// or clicks an HTTP link. Prevents SSL-stripping attacks.
Recommended configuration:
Strict-Transport-Security: max-age=31536000; includeSubDomains; preload
Strict-Transport-Security: max-age=31536000; includeSubDomains; preload
Implementation (Apache):
Header always set Strict-Transport-Security "max-age=31536000; includeSubDomains; preload"
Header always set Strict-Transport-Security "max-age=31536000; includeSubDomains; preload"
Implementation (Nginx):
add_header Strict-Transport-Security "max-age=31536000; includeSubDomains; preload" always;
add_header Strict-Transport-Security "max-age=31536000; includeSubDomains; preload" always;
WIS score impact: Missing HSTS deducts 15 points from the Security dimension. A max-age under 180 days (15,552,000 seconds) deducts 8 points.
Common mistake: Setting max-age too low (e.g., 300 seconds) because you are testing. Once you are confident your site is HTTPS-only, set it to at least one year (31,536,000 seconds).
What it does: Defines which sources of scripts, styles, images, fonts, and other resources are legitimate for your page. The browser refuses to load anything from an unlisted source, neutralising most cross-site scripting (XSS) attacks.
Minimal effective CSP:
Content-Security-Policy: default-src 'self'; script-src 'self' https://cdn.example.com; style-src 'self' 'unsafe-inline'; img-src 'self' data: https:; frame-ancestors 'none'; base-uri 'self'; form-action 'self'
Content-Security-Policy: default-src 'self'; script-src 'self' https://cdn.example.com; style-src 'self' 'unsafe-inline'; img-src 'self' data: https:; frame-ancestors 'none'; base-uri 'self'; form-action 'self'
Implementation tip: Start with report-only mode to identify what would be blocked before enforcing:
Content-Security-Policy-Report-Only: default-src 'self'; report-uri /csp-report
Content-Security-Policy-Report-Only: default-src 'self'; report-uri /csp-report
WIS score impact: Missing CSP deducts 20 points from the Security dimension — the largest single deduction of any header. A weak CSP (e.g., default-src *) deducts 10 points.*
Common mistake: Using unsafe-inline for scripts. This allows inline <script> tags, which is exactly what XSS attackers inject. Use nonces or hashes instead.
What it does: Prevents your pages from being embedded in <iframe> elements on other domains, blocking clickjacking attacks.
Recommended value:
X-Frame-Options: DENY
X-Frame-Options: DENY
Or, if you need to allow embedding from the same origin:
X-Frame-Options: SAMEORIGIN
X-Frame-Options: SAMEORIGIN
Note: The modern equivalent is the CSP frame-ancestors directive. If your CSP already includes frame-ancestors 'none', you do not need X-Frame-Options separately — but having both provides defence in depth for older browsers.
WIS score impact: Missing both X-Frame-Options and frame-ancestors deducts 10 points from the Security dimension.
What it does: Prevents browsers from "MIME-sniffing" — guessing the content type of a response and treating it differently from what the server declared. This stops attacks where a malicious file is uploaded as an image but executed as JavaScript.
Implementation:
X-Content-Type-Options: nosniff
X-Content-Type-Options: nosniff
This header has only one valid value: nosniff. It is one of the simplest headers to add and has zero compatibility risk.
What it does: Controls how much referrer information is included in requests when a user navigates from your site to another. Without this header, the full URL (including query parameters that may contain sensitive data) is sent to third-party sites.
Recommended value:
Referrer-Policy: strict-origin-when-cross-origin
Referrer-Policy: strict-origin-when-cross-origin
This sends the full URL for same-origin requests (useful for analytics) but only the origin (e.g., https://yoursite.com) for cross-origin requests.
What it does: Controls which browser features and APIs your site can use — and prevents embedded third-party content from accessing them. Formerly known as Feature-Policy.
Example configuration (restricting unnecessary features):
Permissions-Policy: camera=(), microphone=(), geolocation=(), payment=()
Permissions-Policy: camera=(), microphone=(), geolocation=(), payment=()
This tells the browser that your site does not need access to the camera, microphone, geolocation, or payment APIs — and that no embedded content should be granted access either.
What it does: Ensures session and authentication cookies cannot be stolen via XSS or sent over insecure connections.
Required flags:
Secure — cookie is only sent over HTTPSHttpOnly — JavaScript cannot read the cookie valueSameSite=Strict or SameSite=Lax — prevents cross-site request forgery (CSRF)Example:
Set-Cookie: session=abc123; Secure; HttpOnly; SameSite=Strict; Path=/
Set-Cookie: session=abc123; Secure; HttpOnly; SameSite=Strict; Path=/
WIS score impact: Cookies without Secure and HttpOnly flags deduct 10 points from the Security dimension.
| Header | Priority | WIS Impact | Implementation Effort |
|---|---|---|---|
| HTTPS / TLS 1.2+ | Critical | −100 if absent | Low (hosting panel) |
| HSTS | High | −15 if absent | Low (1 line) |
| Content-Security-Policy | High | −20 if absent | Medium (requires audit) |
| X-Frame-Options | Medium | −10 if absent | Low (1 line) |
| X-Content-Type-Options | Medium | −5 if absent | Low (1 line) |
| Referrer-Policy | Low | −3 if absent | Low (1 line) |
| Permissions-Policy | Low | −3 if absent | Low (1 line) |
| Cookie Flags | High | −10 if absent | Low–Medium |
Cloudflare's Transform Rules allow you to add security headers without touching your server. Navigate to Rules → Transform Rules → Modify Response Header and add each header as a "Set" action.
Add a vercel.json file to your project root:
{
"headers": [
{
"source": "/(.*)",
"headers": [
{ "key": "Strict-Transport-Security", "value": "max-age=31536000; includeSubDomains; preload" },
{ "key": "X-Frame-Options", "value": "DENY" },
{ "key": "X-Content-Type-Options", "value": "nosniff" },
{ "key": "Referrer-Policy", "value": "strict-origin-when-cross-origin" }
]
}
]
}
{
"headers": [
{
"source": "/(.*)",
"headers": [
{ "key": "Strict-Transport-Security", "value": "max-age=31536000; includeSubDomains; preload" },
{ "key": "X-Frame-Options", "value": "DENY" },
{ "key": "X-Content-Type-Options", "value": "nosniff" },
{ "key": "Referrer-Policy", "value": "strict-origin-when-cross-origin" }
]
}
]
}
In next.config.js:
const securityHeaders = [
{ key: 'X-Frame-Options', value: 'DENY' },
{ key: 'X-Content-Type-Options', value: 'nosniff' },
{ key: 'Strict-Transport-Security', value: 'max-age=31536000; includeSubDomains; preload' },
{ key: 'Referrer-Policy', value: 'strict-origin-when-cross-origin' },
];
module.exports = {
async headers() {
return [{ source: '/(.*)', headers: securityHeaders }];
},
};
const securityHeaders = [
{ key: 'X-Frame-Options', value: 'DENY' },
{ key: 'X-Content-Type-Options', value: 'nosniff' },
{ key: 'Strict-Transport-Security', value: 'max-age=31536000; includeSubDomains; preload' },
{ key: 'Referrer-Policy', value: 'strict-origin-when-cross-origin' },
];
module.exports = {
async headers() {
return [{ source: '/(.*)', headers: securityHeaders }];
},
};
After implementing, verify your headers using any of these methods:
curl -I https://yoursite.com prints all response headersA perfect security header implementation should bring your Security dimension score to 90+ and your overall WIS into the Advanced or Best-in-Class band.
Get a free Website Intelligence Score™ covering security, performance, SEO, and technology stack.
Everything you need to know about migrating your website from HTTP to HTTPS without losing traffic, rankings, or functionality — including SSL certificate setup, redirect configuration, and post-migration verification.
A step-by-step guide to auditing your website's technical SEO — covering crawlability, indexability, structured data, Core Web Vitals, and how to use website intelligence tools to automate the process.
A comprehensive technical guide to making your website faster in 2025 — covering CDNs, image optimisation, Core Web Vitals, caching strategies, and how speed affects your WIS performance score.
The SiteReveal team builds tools that help developers, marketers, and founders understand what's really happening under the hood of any website — from security posture to performance bottlenecks and technology stack fingerprinting.
We use cookies to analyze site traffic, improve performance, and personalize your experience. By clicking "Accept", you consent to our use of cookies in accordance with our Privacy Policy.