<div dir="ltr">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.<div>
<br></div><div>Have cron restart the whole sequence again every hour. You are using Linux/Unix I hope.</div><div><br></div><div>Like I said, it's a dirty but relatively easy solution.</div></div><div class="gmail_extra">
<br><br><div class="gmail_quote">On Tue, Aug 13, 2013 at 11:53 AM, Pablo J. Villarruel <span dir="ltr"><<a href="mailto:pablo@libo.com.ar" target="_blank">pablo@libo.com.ar</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div dir="ltr">Good question!<br></div><div class="gmail_extra"><br><br><div class="gmail_quote"><div><div class="h5">On Tue, Aug 13, 2013 at 10:12 AM, Jaap van Arragon <span dir="ltr"><<a href="mailto:j.vanarragon@lukkien.com" target="_blank">j.vanarragon@lukkien.com</a>></span> wrote:<br>
</div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div class="h5"><div style="font-size:14px;font-family:Calibri,sans-serif;word-wrap:break-word"><div style="font-size:14px;font-family:Calibri,sans-serif">
Hello,</div><div style="font-size:14px;font-family:Calibri,sans-serif"><br></div><div style="font-size:14px;font-family:Calibri,sans-serif">I'am looking for a way to limit the number of connection in one hour to a location named /api/</div>
<div style="font-size:14px;font-family:Calibri,sans-serif"><br></div><div>I've looked at the <span><font color="#333333"><span style="line-height:18px;white-space:pre-wrap">ngx_http_limit_conn_module module but I</span></font> don't understand how to limit the amount of connection from a specific ip address per hour.</span></div>
<div><br></div><div>For example: ip address 33.33.33.33 can only make 20 connections in one hour to the url /api/</div><div><br></div><div>We use nginx as a loadbalancer/proxy.</div><div><br></div><div>Does somebody has a example for this?</div>
<div><br></div><div>Thanks.</div><div><br></div><div>Regards.</div><span><font color="#888888"><div>Jaap <br><br></div><font face="Calibri,sans-serif"><span></span></font></font></span></div>
<br></div></div>_______________________________________________<br>
nginx mailing list<br>
<a href="mailto:nginx@nginx.org" target="_blank">nginx@nginx.org</a><br>
<a href="http://mailman.nginx.org/mailman/listinfo/nginx" target="_blank">http://mailman.nginx.org/mailman/listinfo/nginx</a><span class="HOEnZb"><font color="#888888"><br></font></span></blockquote></div><span class="HOEnZb"><font color="#888888"><br>
<br clear="all"><br>-- <br>-------------------<br>Pablo J. Villarruel / <a href="mailto:pablo@libo.com.ar" target="_blank">pablo@libo.com.ar</a>
</font></span></div>
<br>_______________________________________________<br>
nginx mailing list<br>
<a href="mailto:nginx@nginx.org">nginx@nginx.org</a><br>
<a href="http://mailman.nginx.org/mailman/listinfo/nginx" target="_blank">http://mailman.nginx.org/mailman/listinfo/nginx</a><br></blockquote></div><br></div>