perusio / drupal-with-nginx

Running Drupal using nginx: an idiosyncratically crafted bleeding edge configuration.
855 stars 246 forks source link

Bad Bot #236

Open luk911 opened 8 years ago

luk911 commented 8 years ago

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 servername ; return 444; }

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

Zausenec commented 8 years ago

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