# Block x requests per second

**URL:** <https://www.ruby-forum.com/t/block-x-requests-per-second/201466>\
**Category:** NGINX\
**Created:** [January 7, 2011, 10:44pm UTC](https://www.ruby-forum.com/t/block-x-requests-per-second/201466 "2011-01-07T22:44:26Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![luislavena](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/0ea827/32.png) [@luislavena](https://www.ruby-forum.com/u/luislavena)\
**Post date:** [January 7, 2011, 10:44pm UTC](https://www.ruby-forum.com/t/block-x-requests-per-second/201466/1 "2011-01-07T22:44:26Z")

</div>

Is there a way to block a host if it makes too many requests per second?

Thanks!

---

<div class="post-metadata">

**Author:** ![Team\_AMP](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/f04885/32.png) [@Team\_AMP](https://www.ruby-forum.com/u/Team_AMP)\
**Post date:** [January 8, 2011, 2:32am UTC](https://www.ruby-forum.com/t/block-x-requests-per-second/201466/2 "2011-01-08T02:32:50Z")

</div>

Hello!

On Fri, Jan 07, 2011 at 03:43:31PM -0600, Team AMP wrote:

> Is there a way to block a host if it makes too many requests per second?

Limit req module allows to delay/reject requests which are above  
certain threshold, see here:

> **[GitHub - nginxinc/nginx-wiki: ARCHIVED -- Source for the now archived NGINX Wiki...](https://github.com/nginxinc/nginx-wiki)**
>
> ARCHIVED -- Source for the now archived NGINX Wiki section of https://www.nginx.com

There are not way to block hosts permanently after exceeding  
threshold. Usual aproach is to use fail2ban or something like to  
block them on your firewall if it keeps exceeding limit\_req  
thresholds (e.g. based on limit\_req erros in error\_log.

Maxim D.

---

<div class="post-metadata">

**Author:** ![Team\_AMP](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/f04885/32.png) [@Team\_AMP](https://www.ruby-forum.com/u/Team_AMP)\
**Post date:** [January 8, 2011, 8:13pm UTC](https://www.ruby-forum.com/t/block-x-requests-per-second/201466/3 "2011-01-08T20:13:12Z")

</div>

## For now, I think NginX can only limit by bandwidth usage (CMIIW) If you want to limit by request(s) per second, you can use 3rd party program (eg: firewall)

View this message in context:  
[http://nginx.2469901.n2.nabble.com/block-x-requests-per-second-tp5900967p5902966.html](http://nginx.2469901.n2.nabble.com/block-x-requests-per-second-tp5900967p5902966.html)  
Sent from the nginx mailing list archive at [Nabble.com](http://Nabble.com).
