What does the security headers check do?
It loads a page the way a browser does, follows its redirects, and reviews the HTTP headers that switch on browser protections. Each header gets a verdict, the site gets an A–F grade, and every problem comes with the line to add.
The headers we check
| Header | Protects against | Recommended value |
|---|---|---|
Strict-Transport-Security | Downgrade to HTTP and interception on public Wi-Fi. | max-age=31536000; includeSubDomains |
Content-Security-Policy | Cross-site scripting (XSS) and injected content. | Depends on the site; start with default-src 'self' in report-only mode. |
X-Frame-Options | Clickjacking (your page inside an invisible frame). | SAMEORIGIN, or frame-ancestors 'self' in the CSP. |
X-Content-Type-Options | Files run as scripts because the browser guessed their type. | nosniff |
Referrer-Policy | Leaking full URLs (tokens, searches) to other sites. | strict-origin-when-cross-origin |
Permissions-Policy | Abuse of camera, microphone, location… by embedded code. | camera=(), microphone=(), geolocation=() |
We also flag headers that reveal software versions (Server: Apache/2.4.58, X-Powered-By) and
cookies set without Secure, HttpOnly or SameSite.
How to add them
# Nginx (inside the server block for HTTPS)
add_header Strict-Transport-Security "max-age=31536000; includeSubDomains" always;
add_header X-Frame-Options "SAMEORIGIN" 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=()" always;
# Apache (.htaccess, needs mod_headers)
Header always set Strict-Transport-Security "max-age=31536000; includeSubDomains"
Header always set X-Frame-Options "SAMEORIGIN"
Header always set X-Content-Type-Options "nosniff"
Header always set Referrer-Policy "strict-origin-when-cross-origin"
Behind Cloudflare you can also set them with a Transform Rule (Rules → Transform Rules → Modify Response Header), and HSTS directly in SSL/TLS → Edge Certificates.
Before you enable HSTS
Once a browser has seen HSTS it refuses plain HTTP for that domain until max-age runs out. Make sure the
site and, with includeSubDomains, every subdomain work over HTTPS with a valid certificate first. Check it
with the SSL Checker, and the redirects with the
Redirect Checker.