# Security headers

> 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.

Canonical: https://scaplet.com/glossary/security-headers

Glossary Glossary · Security

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.

4 min

read

6

sources

Oct 25, 2026

updated

Scaplet Editorial Team

author

In one line

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.

30-second check

## Is this costing your site traffic?

Four quick questions, then a straight answer.

1/4Have you checked your own site for this?

Summarize this page with [ChatGPT](https://chatgpt.com/?hints=search&q=Summarize%20https%3A%2F%2Fscaplet.com%2Fglossary%2Fsecurity-headers%20(%22Security%20headers%22)%20in%205%20bullet%20points%2C%20then%20tell%20me%20the%20one%20thing%20I%20should%20do%20next.) [Claude](https://claude.ai/new?q=Summarize%20https%3A%2F%2Fscaplet.com%2Fglossary%2Fsecurity-headers%20(%22Security%20headers%22)%20in%205%20bullet%20points%2C%20then%20tell%20me%20the%20one%20thing%20I%20should%20do%20next.) [Perplexity](https://www.perplexity.ai/search?q=Summarize%20https%3A%2F%2Fscaplet.com%2Fglossary%2Fsecurity-headers%20(%22Security%20headers%22)%20in%205%20bullet%20points%2C%20then%20tell%20me%20the%20one%20thing%20I%20should%20do%20next.) [![Google](/logos/ai/google-color.svg)AI Mode](https://www.google.com/search?udm=50&q=Summarize%20https%3A%2F%2Fscaplet.com%2Fglossary%2Fsecurity-headers%20(%22Security%20headers%22)%20in%205%20bullet%20points%2C%20then%20tell%20me%20the%20one%20thing%20I%20should%20do%20next.)

## At a glance

4 facts from the sources below

HTTP response headers

Type

Web server, CDN or application code

Where set

The visitor's browser

Enforced by

Content-Security-Policy-Report-Only

Safest first step

_01_Explained

## What security headers do

Your server sends a set of headers with every response. A security header is one of those lines that instructs the browser to apply a restriction. The browser enforces it for the visitor, so the protection works even if your own code has a flaw the header was designed to contain.

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".

_02_Common security headers and a starting value

## The main security headers

Header

### `Strict-Transport-Security`

What it controls

Tells browsers to use only [HTTPS](/glossary/https) for the host in future requests

Example value

`max-age=63072000; includeSubDomains; preload`

Header

### `Content-Security-Policy`

What it controls

Which resources a page may load and run, mainly as a defense against cross-site scripting (XSS)

Example value

`default-src 'self'; img-src 'self' example.com`

Header

### `X-Content-Type-Options`

What it controls

Stops the browser from guessing a file's type instead of trusting `Content-Type`

Example value

`nosniff`

Header

### `Referrer-Policy`

What it controls

How much of the previous URL is sent in the `Referer` header

Example value

`strict-origin-when-cross-origin`

Header

### `Permissions-Policy`

What it controls

Which origins may use browser features such as camera, microphone and geolocation

Example value

`geolocation=(), camera=(), microphone=()`

Header

### `X-Frame-Options`

What it controls

Whether the page may be rendered in a frame or iframe, to prevent clickjacking

Example value

`DENY`

The 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.

_03_Checklist

## Gotchas before you copy a config

First_3_
**HSTS must be sent over HTTPS.** Browsers ignore the header on plain HTTP. Send a [permanent redirect](/glossary/301-redirect) to the `https` URL from HTTP, and put the header on the HTTPS response.

**HSTS is sticky.** If a response stops sending the header, the earlier policy stays in effect until `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.

Next_2_
**`includeSubDomains` covers every subdomain.** Check that all of them serve HTTPS before you add it.

**CSP can break your own pages.** An inline script or a third-party tag that your policy does not allow will be blocked. Start with the report-only header.

Then_2_
**Frame control has moved.** OWASP notes that the CSP `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.

**Referrer defaults exist.** OWASP says modern browsers default to `strict-origin-when-cross-origin`, and still recommends setting the header explicitly rather than relying on browser defaults.

_04_How it works

## How to roll them out safely

1. 01

### See what you send now

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.
2. 02

### Add the low-risk headers

`X-Content-Type-Options: nosniff` and an explicit `Referrer-Policy` rarely break anything. Confirm that every response carries a correct `Content-Type` first.
3. 03

### Turn on HSTS with a short max-age

Once the whole site works on HTTPS, send `Strict-Transport-Security` with a small `max-age`, then raise it as you gain confidence.
4. 04

### Test CSP in report-only mode

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.
5. 05

### Set it where it is easiest to maintain

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.

_05_Explained

## Do security headers affect SEO?

None of the sources cited here describe security headers as a search ranking signal, so treat them as a security and trust measure. The indirect effects are practical. HSTS and a clean HTTPS setup avoid [mixed content](/seo-issues/mixed-content-issue) and redirect hops, and a bad CSP can block scripts your pages need to render, which does affect what crawlers see. Test a page in the [URL Inspection tool](/glossary/url-inspection-tool) after a CSP change.

Sources · 6

## Every fact, linked and dated.

Official docs first. The date is when we last opened each page.

- owasp.org
- mozilla.org

1. 01 [OWASP Secure Headers Project](https://owasp.org/projects/secure-headers-project) owasp.org · checked 2026-10-25
2. 02 [OWASP HTTP Headers Cheat Sheet](https://cheatsheetseries.owasp.org/cheatsheets/HTTP_Headers_Cheat_Sheet.html) cheatsheetseries.owasp.org · checked 2026-10-25
3. 03 [MDN: Strict-Transport-Security header](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Strict-Transport-Security) developer.mozilla.org · checked 2026-10-25
4. 04 [MDN: Content Security Policy (CSP)](https://developer.mozilla.org/en-US/docs/Web/HTTP/Guides/CSP) developer.mozilla.org · checked 2026-10-25
5. 05 [MDN: X-Content-Type-Options header](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/X-Content-Type-Options) developer.mozilla.org · checked 2026-10-25
6. 06 [MDN: Practical implementation guides](https://developer.mozilla.org/en-US/docs/Web/Security/Practical_implementation_guides) developer.mozilla.org · checked 2026-10-25

Questions

## Asked a lot.

4 questions people ask next, answered from the sources on this page.

_01_ What are security headers?

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.

_02_ What are all the security headers used in HTTP?

The OWASP HTTP Headers Cheat Sheet covers [X-Frame-Options](/glossary/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.

_03_ Do I still need X-Frame-Options?

OWASP says the CSP frame-ancestors directive obsoletes it for supporting browsers. MDN calls frame-ancestors a more flexible replacement.

_04_ Where do I set security headers?

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.

## Keep learning

[All glossary](/glossary)

[Learn X-Frame-Options Crawling and indexing](/glossary/x-frame-options) [Related HTTPS Crawling and indexing](/glossary/https) [Read next CORS Performance](/glossary/cors) [Do Run a free site audit Free, about two minutes](/site-audit)

Nearby in glossary
[Search Quality Rater Guidelines](/glossary/search-quality-rater-guidelines) [Search volume](/glossary/search-volume) [Seed keywords](/glossary/seed-keywords) [SEM](/glossary/sem)

More in Technical SEO
[Content migration](/glossary/content-migration) [Hidden text](/glossary/hidden-text) [JSON Feed](/glossary/json-feed) [Mobile friendly](/glossary/mobile-friendly) [Mobile-first indexing](/glossary/mobile-first-indexing) [MX record (mail exchange)](/glossary/mx-record) [Rate limiting](/glossary/rate-limiting) [React SEO](/glossary/react-seo) [Security headers](/glossary/security-headers) [TXT record](/glossary/txt-record)

Terms on this page
[HTTPS](/glossary/https) [301 redirect](/glossary/301-redirect) [URL Inspection tool](/glossary/url-inspection-tool) [X-Frame-Options](/glossary/x-frame-options)

Free · 2 minutes

## Know the term. _Now check your site._

The free audit reads robots.txt, sitemaps, status codes, canonicals, redirects and structured data.

[Audit my site free](/site-audit)

Free, no card 60 seconds Nobody will call you

- **46** fixes shipped without a ticket Brightpipe
- **+212%** organic clicks in 90 days Ledgerly
