Blocking by user agent if ip doesn't match
António P. P. Almeida
appa at perusio.net
Wed Jun 1 02:57:39 MSD 2011
On 31 Mai 2011 23h44 WEST, nginx-forum at nginx.us wrote:
> Thanks Antonio, so far we've only had fake google bots so it seems
> fine as it is for now. But I'll apply those if there is any issue
> with Yahoo or some other spider being faked. I am assuming that
> other user agents are not affected by the current rule.
No the default value of $bots is 0. Only in the case of a UA string
containing google (case insensitive) is the IP verified. Otherwise,
since you dropped the line that matched the bad bots UA, all other
bots are allowed.
This is a good approach for handling bots spoofing the UA string and
also a cleaner way to block unwanted bots.
--- appa
More information about the nginx
mailing list