Strict-Transport-Security
- What it controls
- Tells browsers to use only HTTPS for the host in future requests
- Example value
max-age=63072000; includeSubDomains; preload
Security headers are HTTP response headers that tell browsers how to handle your site. See the main ones, example values, a rollout order and how to test them.
Security headers are HTTP response headers that tell a browser how to treat your site's content, such as only using HTTPS, loading scripts from approved sources or not being embedded in other sites. The OWASP Secure Headers Project describes them as headers that, once set, can restrict modern browsers from running into easily preventable vulnerabilities.
Four quick questions, then a straight answer.
From your answers, this is quietly costing you traffic and nobody has the hours to chase it. Scaplet finds every affected page, drafts the fixes and tracks how AI answers mention you.
A data platform shipped 46 fixes without a ticket.
This looks handled. Re-check after a redesign, a migration or a big content push; that is when it breaks.
Your site is small and you have the time. Work through the steps on this page, starting with the pages that get the most traffic.
They are not a replacement for fixing vulnerabilities. They are a second layer. MDN's practical guides say they "cannot guarantee complete security of your website", but that following them "will make your sites significantly more secure".
Strict-Transport-Securitymax-age=63072000; includeSubDomains; preloadContent-Security-Policydefault-src 'self'; img-src 'self' example.comX-Content-Type-OptionsContent-TypenosniffReferrer-PolicyReferer headerstrict-origin-when-cross-originPermissions-Policygeolocation=(), camera=(), microphone=()X-Frame-OptionsDENYThe example values come from MDN and the OWASP HTTP Headers Cheat Sheet. They are starting points, not universal settings. The OWASP cheat sheet also lists Cross-Origin-Opener-Policy, Cross-Origin-Embedder-Policy and Cross-Origin-Resource-Policy, which matter for sites that need cross-origin isolation.
https URL from HTTP, and put the header on the HTTPS response.max-age runs out. To disable it, set max-age=0 over HTTPS.preload has requirements. MDN says max-age must be at least 31536000 (1 year) and includeSubDomains must be present.includeSubDomains covers every subdomain. Check that all of them serve HTTPS before you add it.frame-ancestors directive obsoletes X-Frame-Options for supporting browsers. Setting frame-ancestors 'none' is MDN's advice unless you need the site to be embeddable.strict-origin-when-cross-origin, and still recommends setting the header explicitly rather than relying on browser defaults.Run curl -sI https://yoursite.com/ and read the response headers. Check a few templates, not only the home page, and check static files and API routes too, since CSP should be set on every response.
X-Content-Type-Options: nosniff and an explicit Referrer-Policy rarely break anything. Confirm that every response carries a correct Content-Type first.
Once the whole site works on HTTPS, send Strict-Transport-Security with a small max-age, then raise it as you gain confidence.
Send Content-Security-Policy-Report-Only with your draft policy. MDN says violations are reported but the policy is not enforced. Fix what it flags, then switch to the enforcing header.
Use your web server config, CDN rules or application middleware, and keep one source of truth so that a redirect rule or cached response does not drop the headers.
4 questions people ask next, answered from the sources on this page.
They are HTTP response headers that instruct the browser to apply restrictions to your site, such as only using HTTPS, limiting where scripts load from or blocking framing. OWASP's Secure Headers Project describes them as headers that can stop modern browsers running into easily preventable vulnerabilities.
The OWASP HTTP Headers Cheat Sheet covers X-Frame-Options, X-Content-Type-Options, Referrer-Policy, Strict-Transport-Security, Content-Security-Policy, Cross-Origin-Opener-Policy, Cross-Origin-Embedder-Policy, Cross-Origin-Resource-Policy and Permissions-Policy, among others.
OWASP says the CSP frame-ancestors directive obsoletes it for supporting browsers. MDN calls frame-ancestors a more flexible replacement.
In your web server configuration, your CDN or your application code. OWASP's cheat sheet shows examples for Apache, Nginx, IIS, HAProxy, PHP and Express. With Nginx, add the always option, or the header is only sent for certain status codes.
The free audit reads robots.txt, sitemaps, status codes, canonicals, redirects and structured data.