The list of “essential” HTTP security headers has shifted enough in the last few years that a 2022 hardening guide will leave you with deprecated headers, conflicting policies, and a Content-Security-Policy nobody trusts enough to enforce. Here’s the set we actually ship in 2026, and what we deliberately don’t.
What’s happening
Three headers that used to be on every checklist — X-XSS-Protection, Expect-CT, and Public-Key-Pins — are now either ignored or actively discouraged. Meanwhile, the headers that matter most depend on what the application does: a server that issues cookies and serves authenticated content needs a different baseline than a static marketing site behind a CDN. The default WordPress or Nginx config sets none of them.
How to verify
Check what the server is actually returning, including for both root and an authenticated path:
curl -sIL https://example.com/ | grep -iE 'strict-transport|content-security|x-content-type|x-frame|referrer|permissions|cross-origin'
curl -sIL https://example.com/wp-admin/ | grep -iE 'strict-transport|content-security|x-content-type|x-frame|referrer|permissions'
Then validate the CSP against real page loads with the browser DevTools console open, or run the policy in report-only mode for a week before enforcing.
The fix
The defensible 2026 set, expressed for Nginx:
add_header Strict-Transport-Security "max-age=63072000; includeSubDomains; preload" always;
add_header Content-Security-Policy "default-src 'self'; script-src 'self' 'nonce-$cspNonce'; style-src 'self' 'unsafe-inline'; img-src 'self' data: https:; connect-src 'self'; frame-ancestors 'none'; base-uri 'self'; form-action 'self'" always;
add_header X-Content-Type-Options "nosniff" always;
add_header Referrer-Policy "strict-origin-when-cross-origin" always;
add_header Permissions-Policy "camera=(), microphone=(), geolocation=(), payment=()" always;
add_header Cross-Origin-Opener-Policy "same-origin" always;
add_header Cross-Origin-Resource-Policy "same-origin" always;
Four notes:
X-Frame-Options: DENYis now covered byframe-ancestors 'none'in CSP. Keep both only if you still serve clients on browsers from 2019.unsafe-inlinefor styles is a compromise — WordPress themes and most page builders still inline styles. Removing it is a project, not a flip.- Use a per-request nonce for inline scripts. A static nonce or
'unsafe-inline'for scripts defeats the point of having CSP at all. alwaysmatters. Without it, headers won’t be sent on error responses, which is where attackers often find the easiest exploits.
Roll out CSP in Content-Security-Policy-Report-Only mode first, collect a week of report-uri data, then enforce. Anything else means rolling back during a launch window.
Long-term, header policy belongs in the same change pipeline as application config — that’s part of how we operate environments under Environment Management.