HeaderScout

Check 04 · REF

Referrer policy

Referrer-Policy

Referrer-Policy decides how much of a page's address the browser passes on when a visitor follows a link or the page loads something from elsewhere.

What it does

When a browser leaves one page for another, or fetches an image or script, it can send the address of the page it came from in the Referer request header (spelled that way since the early days of the web). Page addresses can contain search terms, account numbers, reset tokens or other things that shouldn't travel to other sites.

Current browsers already default to strict-origin-when-cross-origin, which is why a missing header still earns half the points. Setting a policy yourself keeps that behavior in older browsers and stops a weaker setting elsewhere from taking over.

What each value sends

ValueWithin your siteTo other HTTPS sitesTo HTTP sites
no-referrerNothingNothingNothing
same-originFull addressNothingNothing
strict-originDomain onlyDomain onlyNothing
originDomain onlyDomain onlyDomain only
strict-origin-when-cross-originFull addressDomain onlyNothing
origin-when-cross-originFull addressDomain onlyDomain only
no-referrer-when-downgradeFull addressFull addressNothing
unsafe-urlFull addressFull addressFull address

How we score it

20no-referrer, same-origin, strict-origin, origin or strict-origin-when-cross-origin.
10No header, or no value browsers recognize. Current browsers then use a protective default, but an explicit policy keeps it that way.
0An explicit weak policy: unsafe-url, no-referrer-when-downgrade or origin-when-cross-origin.

When the header lists several values, the last one browsers recognize applies.

All five checks and the grade scale: How grading works.

Examples

  1. Referrer-Policy: strict-origin-when-cross-origin

    20 / 20 · Strong Full addresses stay within your site; other sites see only your domain.

  2. Referrer-Policy: no-referrer

    20 / 20 · Strong Nothing is ever sent. Other sites then see visits from you as direct visits.

  3. No header.

    10 / 20 · Partial Browsers fall back to their own default, which is protective today.

  4. Referrer-Policy: unsafe-url

    0 / 20 · Weak Full addresses go everywhere, even over plain HTTP.

  5. Referrer-Policy: no-referrer-when-downgrade

    0 / 20 · Weak Full addresses go to every other HTTPS site.

  6. Referrer-Policy: unsafe-url, strict-origin-when-cross-origin

    20 / 20 · Strong A list: the last value the browser recognizes applies, so this one is strong.

  7. Referrer-Policy: no-referrer, made-up-value

    20 / 20 · Strong Values a browser doesn't know are skipped, which makes lists a way to add newer values with a fallback.

How to set it

strict-origin-when-cross-origin suits most sites. Use no-referrer or same-origin if other sites don't need to know visits came from you.

A single link can still opt out with rel="noreferrer", but only the header sets the rule for the whole page, and only the header is scored.

Referrer-Policy: strict-origin-when-cross-origin
Nginx

Put this in the server block. A location block with its own add_header lines doesn’t inherit these, so repeat them there.

add_header Referrer-Policy "strict-origin-when-cross-origin" always;
Apache

In the virtual host or .htaccess. Needs mod_headers (on Debian and Ubuntu: a2enmod headers).

Header always set Referrer-Policy "strict-origin-when-cross-origin"
Caddy

Inside your site block in the Caddyfile.

header Referrer-Policy "strict-origin-when-cross-origin"
Cloudflare

Rules → Create rule → Response Header Transform Rule. Apply to all incoming requests, choose “Set static”, and enter each header below.

Header name: Referrer-Policy
Value: strict-origin-when-cross-origin

Common mistakes

  • Setting unsafe-url or no-referrer-when-downgrade so partners see full addresses in their statistics. Any token in an address goes with it.
  • Putting the weak value last in a list. The last recognized value wins.

See what your site sends

One request to your homepage. Results are public.