Security headers
Referrer-Policy controls how much of the current page's URL is sent to other sites in the Referer header when a visitor clicks a link or loads a resource.
Not sure whether your site has this problem? Check it in seconds.
Full URLs can contain private details such as account IDs, search terms or reset tokens. Limiting what is shared reduces accidental leakage to third-party sites and analytics.
Look for Referrer-Policy in the response headers, or a <meta name="referrer"> tag in the page.
Header value
Referrer-Policy: strict-origin-when-cross-originNginx
add_header Referrer-Policy "strict-origin-when-cross-origin" always;Apache
Header always set Referrer-Policy "strict-origin-when-cross-origin"Next.js (next.config.ts)
const nextConfig = {
async headers() {
return [
{
source: "/:path*",
headers: [{ key: "Referrer-Policy", value: "strict-origin-when-cross-origin" }],
},
];
},
};
export default nextConfig;Current browsers default to strict-origin-when-cross-origin, but setting it explicitly makes your behaviour consistent across browsers and versions.
Guidance is general. Test header and DNS changes on a staging copy first, and check your hosting provider's documentation for platform-specific steps.