Blocking by user agent if ip doesn't match

Igor Sysoev igor at sysoev.ru
Wed Jun 1 11:28:07 MSD 2011


On Tue, May 31, 2011 at 06:01:19PM -0400, karabaja wrote:
> Thanks everyone for being so helpful. I've ended up applying Igor's
> suggestion. 
> But I've dropped this line as I wasn't sure what to do with it:
> "~(?i)(Purebot|Lipperhey|MaMaCaSpEr|libwww-perl|Mail.Ru|gold crawler)"
> 1;
> 
> I am guessing it can be used if I want to match more then just google's
> user agent. But in any case what I did worked very nice. 
> I tested it using Firefox user agent and I got forbidden page, then
> tried adding my ip to geo bit and I was allowed. 

I misread your message and thought that you block alreay these bots,
so I have added them to block despite their IPs.


-- 
Igor Sysoev



More information about the nginx mailing list