Limit connections to endpoint

Valentin V. Bartenev vbart at nginx.com
Thu Jul 17 11:06:50 UTC 2014


On Thursday 17 July 2014 06:57:51 vocativus wrote:
> ok I found that yesterday, and as a variable in limit_req_zone I should use
> some constant eg: set $con 10;
> 
> and it looks like:
> 
> set $con 10;
> limit_req_zone $con zone=one:15m rate=10r/s;

You don't need "set" to create a constant.  There are already a few constants
always available like $nginx_version.

http://nginx.org/en/docs/http/ngx_http_core_module.html#variables

> 
> and it should work as I want? Aking, because I'm testnig it now, and it dont
> work properly.
> 

Could you elaborate what's the problem, and provide your configuration?

  wbr, Valentin V. Bartenev



More information about the nginx mailing list