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
| Value | Within your site | To other HTTPS sites | To HTTP sites |
|---|---|---|---|
no-referrer | Nothing | Nothing | Nothing |
same-origin | Full address | Nothing | Nothing |
strict-origin | Domain only | Domain only | Nothing |
origin | Domain only | Domain only | Domain only |
strict-origin-when-cross-origin | Full address | Domain only | Nothing |
origin-when-cross-origin | Full address | Domain only | Domain only |
no-referrer-when-downgrade | Full address | Full address | Nothing |
unsafe-url | Full address | Full address | Full address |
How we score it
| 20 | no-referrer, same-origin, strict-origin, origin or strict-origin-when-cross-origin. |
|---|---|
| 10 | No header, or no value browsers recognize. Current browsers then use a protective default, but an explicit policy keeps it that way. |
| 0 | An 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
- Referrer-Policy: strict-origin-when-cross-origin
20 / 20 · Strong Full addresses stay within your site; other sites see only your domain.
- Referrer-Policy: no-referrer
20 / 20 · Strong Nothing is ever sent. Other sites then see visits from you as direct visits.
- No header.
10 / 20 · Partial Browsers fall back to their own default, which is protective today.
- Referrer-Policy: unsafe-url
0 / 20 · Weak Full addresses go everywhere, even over plain HTTP.
- Referrer-Policy: no-referrer-when-downgrade
0 / 20 · Weak Full addresses go to every other HTTPS site.
- 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.
- 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.
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-originCommon mistakes
- Setting
unsafe-urlorno-referrer-when-downgradeso 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.