Step 1: the low-risk headers
These rarely break anything:
X-Content-Type-Options: nosniff
Referrer-Policy: strict-origin-when-cross-origin
X-Frame-Options: DENY
Permissions-Policy: camera=(), microphone=(), geolocation=()Use SAMEORIGIN instead of DENY if your own site frames its pages.
Try it Check which headers are missing
Full tool: Security Headers Checker
Step 2: HSTS
Strict-Transport-Security: max-age=31536000; includeSubDomainsOnly add it once every subdomain works over HTTPS: browsers will refuse plain HTTP for the whole max-age. Start with a short max-age (for example 300) if unsure. Add preload only if you intend to submit to the browser preload list, which is hard to undo.
Step 3: Content-Security-Policy
Deploy as Content-Security-Policy-Report-Only first, review the violations in the browser console or your report endpoint, then switch the header name to enforce. A starting point for a simple site:
default-src 'self'; img-src 'self' data:; object-src 'none'; base-uri 'self'; frame-ancestors 'none'Add the exact domains your site loads scripts, fonts and analytics from.
Where to add them
Nginx — in the server block: add_header X-Content-Type-Options "nosniff" always;
Apache — with mod_headers: Header always set X-Content-Type-Options "nosniff"
Cloudflare — Rules → Transform Rules → Modify Response Header, or in a Worker.
Netlify / Cloudflare Pages — a _headers file in the site root:
/*
X-Content-Type-Options: nosniff
Referrer-Policy: strict-origin-when-cross-originVerify the fix
Re-run the checker above. Headers are cached by CDNs, so purge the cache if a change does not appear. Then browse key pages with the developer console open to catch CSP violations.
See the whole picture
Run the full Recon Snapshot to check DNS, email authentication, certificates, hosting, exposed services, security headers and lookalike domains together, with a plain-English fix for every finding.
Run a full snapshotReferences
About this guide
Drafted with AI assistance and checked against the primary sources listed above; its embedded tool was tested against live domains before publication. It was last checked on November 25, 2026; standards and provider requirements change, so confirm critical settings against the references. Found an error? Tell us.
Related guides
- Understanding Website Security HeadersWhat HSTS, Content-Security-Policy, X-Frame-Options, X-Content-Type-Options, Referrer-Policy and Permissions-Policy do, and which matter most.
- How to Check an SSL CertificateCheck when an SSL/TLS certificate expires, who issued it and which names it covers, in the browser, with OpenSSL, or with a free online checker.