Block referrer url in nginx

From DevOps Notebook
Revision as of 12:00, 30 October 2020 by MilosZ (talk | contribs) (Created page with "In order to block referral url in nginx, add in server block: <pre> if ($http_referer ~* badwebsite.com) { return 403; } </pre>")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

In order to block referral url in nginx, add in server block:

if ($http_referer ~* badwebsite.com) {
   return 403;
}