limit_conn question

Igor Sysoev is at rambler-co.ru
Tue Oct 6 18:12:09 MSD 2009


On Tue, Oct 06, 2009 at 03:43:10PM +0200, Tomasz Pajor wrote:

> Why limit_conn is not allowed in such a configuration?
> 
> #http context
> 
> limit_zone resp_zone $binary_remote_addr 64m;
> geo $limit_conn {
>     default 1;
>     x.x.x.x/32 0;
>     z.z.z.z/32 0;
>     y.y.y.y/32 0;
> }
> 
> #server context
> server {
>     listen 80;
> 
>     if ($limit_conn) {
>         limit_conn resp_zone 5;
>     }
> 
>     location / { proxy_pass http://127.0.0.1:8080; }
> 
>     error_page 500 501 502 503 504 505 /50x.html;
>     location /50x.html {
>         #root /vhosts/overload;
>         root /vhosts/maintenance;
>     }
> 
>     include base/status;
> }

This is not possible now. I plan to add in the next version

   limit_conn  conn=5  zone=resp_zone  if=$limit_conn;


-- 
Igor Sysoev
http://sysoev.ru/en/





More information about the nginx mailing list