drupal-with-nginx icon indicating copy to clipboard operation
drupal-with-nginx copied to clipboard

Bad Bot

Open luk911 opened this issue 9 years ago • 1 comments
trafficstars

I try to block bad referrer, this one: referrer: "http://www.muzformat.com/index.php?productID=807"

I change blacklist.conf

to:

map $http_referer $bad_referer { default 0; ~(?i)(adult|babes|diamond|forsale|girl|jewelry|love|nudit|organic|poker|porn|poweroversoftware|sex|teen|webcam|zippo|casino|replica|muzformat) 1; }

include

if ($bad_referer) { return 444; }

in my conf, but bot are style there.

and can we consolidate this rule in 000-default.conf for all domain ? like this:

server { listen 80; # IPv4 server_name _; return 444; }

server { listen 80 default_server; # IPv4 if ($bad_bot) { return 444; } if ($bad_referer) { return 444; } if ($not_allowed_method) { return 405; } }

luk911 avatar Feb 14 '16 10:02 luk911

Comment out the "geo" section in blacklist.conf, it overwrites $bad_referer variable with empty string.

Zausenec avatar Aug 23 '16 23:08 Zausenec