# Limit\_conn - block offending ips

**URL:** <https://www.ruby-forum.com/t/limit-conn-block-offending-ips/193182>\
**Category:** NGINX\
**Created:** [August 12, 2010, 5:16pm UTC](https://www.ruby-forum.com/t/limit-conn-block-offending-ips/193182 "2010-08-12T17:16:39Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![piramida](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/3ab097/32.png) [@piramida](https://www.ruby-forum.com/u/piramida)\
**Post date:** [August 12, 2010, 5:16pm UTC](https://www.ruby-forum.com/t/limit-conn-block-offending-ips/193182/1 "2010-08-12T17:16:39Z")

</div>

Hi forum and thanks Igor for the most amazing software;  
now I have spent some time looking for a way to make use of the  
limit\_conn directive to block offending ip addresses, but can’t seem to  
figure out a way to do so.

Is there a possibility to check, inside nginx.conf, for  
$limit\_conn\_triggered or something like that? Use case - I am protecting  
a backend server with limit\_conn zone\_name 2; and want to collect ips  
that violate that limit for blocking in the firewall. Parsing logs is a  
possible but extremely ineffective solution, especially under a DDOS, so  
I was looking for a way to either block violators using nginx  
configuration or emit the ip address to iptables/apf/etc.

Currently I can only deny parallel requests or limit\_req them, which  
surely does increase the number of attackers needed to kill the server  
but does not solve the problem. Somehow, I feel there should be a  
solution (nginx module or directive I’m missing) which could ban based  
on triggered limit\_conn. Thanks for any tips 🙂

Posted at Nginx Forum:

> **[limit\_conn - block offending ips](https://forum.nginx.org/read.php?2,119081,119081#msg-119081)**
>
> Hi forum and thanks Igor for the most amazing software; now I have spent some time looking for a way to make use of the limit\_conn directive to block offending ip addresses, but can't seem to figure out a way to do so. Is there a possibility to...
