Skip to content

Security headers

Referrer-Policy

Referrer-Policy controls how much of your page's address is sent to other sites when visitors follow a link or load a resource.

Scanetra rating: ObservationCheck HDR-04

Why it matters

Page addresses can contain private details such as search terms, reset tokens or IDs. Browsers already default to a safe setting, so a missing header is only a note; unsafe-url undoes that default.

What Scanetra looks for

  • Whether Referrer-Policy is set.
  • Whether it's set to unsafe-url, which sends the full address everywhere.

It reads only your homepage's public response. How a scan works

How to fix it

nginx

In the server block that serves HTTPS. The always flag also adds it to error pages.

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

Apache

Needs mod_headers. In the VirtualHost or .htaccess.

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

Cloudflare

Rules › Transform Rules › Modify Response Header: create a rule for all incoming requests that sets the static header Referrer-Policy to the value below.

strict-origin-when-cross-origin

Vercel

In vercel.json at the root of the project.

{
  "headers": [
    {
      "source": "/(.*)",
      "headers": [{ "key": "Referrer-Policy", "value": "strict-origin-when-cross-origin" }]
    }
  ]
}

Netlify

In a file named _headers in the publish directory.

/*
  Referrer-Policy: strict-origin-when-cross-origin

Replace example.com with your own domain, and test changes on a staging copy first where you can.

Check that it worked

The response headers include Referrer-Policy with strict-origin-when-cross-origin or stricter. Then scan again.

Check your own site

A free scan tells you whether your site passes this check, and the 24 others.

Scan a website