Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I need to block an IP-address which tries to download my entire website. Currently I've blocked it using iptables.

Is there any way to block an IP automatically if it's trying to request to many pages, i.e. downloading an entire website?

P.S. I'm using Nginx as frontend to Apache.

Thank you!

share|improve this question
add comment

2 Answers

up vote 2 down vote accepted

Another possible option would be to use fail2ban. Under Debian this is part of the standard pacakges, for other distros you might have to get the original source and install/configure manually.

This is a package that can monitor all sorts of things and trigger an (IPtables based) block on the requesting IP address. You might have to experiment a little for this particular thing, but I would be surprised if it couldn't be made to work.

I use it on most of my servers, mostly to keep those irritating ssh login attempts from kiddy hackers under control, and it works like a charm.

share|improve this answer
add comment

Read the Serverfault blog: http://blog.serverfault.com/post/1016491873/better-rate-limiting-for-all-with-haproxy

share|improve this answer
    
I don't want to install any other software. I need to solve this with nginx and apache only. –  user38484 Aug 30 '10 at 9:57
    
@user38484: the Stack Overflow guys documented an nginx-only solution too: blog.serverfault.com/post/632866473/… –  Paul D. Waite Jun 14 '13 at 10:11
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.