Domain security

Which HTTP security headers should every website send?

Reviewed 2 November 2026 by the SageRank team

Short answer

Every website should send Strict-Transport-Security, a Content-Security-Policy, X-Content-Type-Options: nosniff, a frame-ancestors rule to stop clickjacking, a Referrer-Policy and a Permissions-Policy. Start Content-Security-Policy in report-only mode, because a strict policy can break scripts you rely on.

The checklist

HeaderExample valueWhat it does
Strict-Transport-Securitymax-age=31536000; includeSubDomainsForces HTTPS
Content-Security-Policydefault-src 'self'; frame-ancestors 'none'Limits where scripts, styles and frames may load from
X-Content-Type-OptionsnosniffStops browsers guessing file types
Referrer-Policystrict-origin-when-cross-originLimits what URL data is sent to other sites
Permissions-Policycamera=(), microphone=(), geolocation=()Turns off browser features you do not use

Content-Security-Policy, carefully

CSP is the most powerful and the easiest to get wrong. Begin with Content-Security-Policy-Report-Only so the browser reports problems without blocking anything, fix what the reports show, then enforce.

Clickjacking

Use the CSP frame-ancestors directive to control who may embed your pages. The older X-Frame-Options header still works as a fallback.

Skip the obsolete ones

X-XSS-Protection is deprecated in modern browsers and can introduce problems. A good CSP replaces it.

How to add them

Set them at your host or CDN: in vercel.json headers, an nginx add_header, or your framework’s middleware. Then check the live response with curl -I https://www.example.com.

How SageRank helps

The free report does not test domain security. SageRank’s Sentinel and Ultimate plans run ten levels of domain security checks through ShieldAI. See ShieldAI.