Welcome! Log In Create A New Profile

Advanced

Specify more than one variable for limit_req_zone / limit_conn_zone

Posted by Yumi 
Specify more than one variable for limit_req_zone / limit_conn_zone
June 17, 2014 12:50AM
Currently limit_req_zone and limit_conn_zone require exactly one variable to be set.
It would be more flexible if this could be a string, similar to how the proxy_cache_key directive works, for example.

Example uses:

# restrict an end user from constantly refreshing the same page
limit_req_zone $binary_remote_addr$uri zone=ipUri:2m rate=1r/s;

# limit total number of connections to a resource (can probably already be done with a dummy variable, but looks nicer with a string)
limit_conn_zone - zone=connLimit:2m;
Re: Specify more than one variable for limit_req_zone / limit_conn_zone
September 30, 2014 07:56PM
Yay, included in 1.7.6! http://nginx.org/en/CHANGES
Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 148
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 500 on July 15, 2024
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready