Add basic HTTP security headers
Strict-Transport-Security, X-Content-Type-Options and a frame policy protect visitors from common attacks with a few lines of configuration.
The problem
The homepage response is missing recommended security headers.
How to spot it
The audit lists the missing headers. You can also see the response headers in your browser's network tab.
Why it matters
These headers tell browsers to always use HTTPS, not to guess file types, and not to let other sites frame your pages (clickjacking).
What happens if you leave it
Visitors are more exposed to downgrade attacks and clickjacking.
How to fix it
-
Add the headers at the web server or CDN. Nginx example:
add_header X-Content-Type-Options "nosniff" always; add_header X-Frame-Options "SAMEORIGIN" always; add_header Referrer-Policy "strict-origin-when-cross-origin" always; add_header Strict-Transport-Security "max-age=31536000" always; -
HSTS caution: only send
Strict-Transport-Securityonce HTTPS works on the whole domain. Start with a shortmax-age(for example one day) and increase it. AddincludeSubDomainsonly if every subdomain supports HTTPS. -
Content-Security-Policy gives the strongest protection but needs care, because a strict policy can break third-party scripts. Start with
Content-Security-Policy-Report-Onlyto see what would be blocked.
Common mistakes
- Enabling long-lived HSTS before HTTPS works everywhere.
- Copying a strict CSP that breaks analytics, chat widgets or payments.
How to check the fix worked
Check the response headers with your browser or curl -I https://www.example.com/. Re-run the audit.
References and further reading
Related tutorials
Serve everything over HTTPS and fix mixed content
Redirect all HTTP traffic to HTTPS with a permanent redirect, and make sure HTTPS pages do not load any http:/...
Speed up slow server responses and heavy pages
Reduce time to first byte with caching and better hosting, slim down oversized HTML, and measure real performa...