Limit connection to specific location

Bob S. farseas at gmail.com
Tue Aug 13 17:23:15 UTC 2013


One dirty way to do it would be to use a program to monitor the connections
that access that location and then, when 20 connections in an hour have
occurred, have the config file swapped out and replaced with another that
does not have that location block. There is a way to get Nginx to reread
it's config file without shutting it down.

Have cron restart the whole sequence again every hour. You are using
Linux/Unix I hope.

Like I said, it's a dirty but relatively easy solution.


On Tue, Aug 13, 2013 at 11:53 AM, Pablo J. Villarruel <pablo at libo.com.ar>wrote:

> Good question!
>
>
> On Tue, Aug 13, 2013 at 10:12 AM, Jaap van Arragon <
> j.vanarragon at lukkien.com> wrote:
>
>> Hello,
>>
>> I'am looking for a way to limit the number of connection in one hour to a
>> location named /api/
>>
>> I've looked at the ngx_http_limit_conn_module module but I don't
>> understand how to limit the amount of connection from a specific
>> ip address per hour.
>>
>> For example: ip address 33.33.33.33 can only make 20 connections in one
>> hour to the url /api/
>>
>> We use nginx as a loadbalancer/proxy.
>>
>> Does somebody has a example for this?
>>
>> Thanks.
>>
>> Regards.
>> Jaap
>>
>>
>> _______________________________________________
>> nginx mailing list
>> nginx at nginx.org
>> http://mailman.nginx.org/mailman/listinfo/nginx
>>
>
>
>
> --
> -------------------
> Pablo J. Villarruel / pablo at libo.com.ar
>
> _______________________________________________
> nginx mailing list
> nginx at nginx.org
> http://mailman.nginx.org/mailman/listinfo/nginx
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.nginx.org/pipermail/nginx/attachments/20130813/67c914cc/attachment.html>


More information about the nginx mailing list