Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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
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

Read the Serverfault blog:

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:… – Paul D. Waite Jun 14 '13 at 10:11

Your Answer


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.