Francis,
what is the same "key " for all requests from different client ips for 
limit_conn_zone/limit_req_zone? I have no idea on this.



Tong
 
From: Francis Daly
Date: 2017-11-30 18:17
To: nginx
Subject: Re: How to control the total requests in Ngnix
On Thu, Nov 30, 2017 at 05:12:18PM +0800, [email protected] wrote:
 
Hi there,
 
> I want to use ngnix to protect my system,to allow max 2000 requests sent to 
> my service(http location).
> The below configs are only for per client ip,not for the total requests 
> control.
 
> ##########method 1##########
> 
> limit_conn_zone $binary_remote_addr zone=addr:10m;
 
http://nginx.org/r/limit_conn_zone
 
If "key" is "$binary_remote_addr", it will be the same for the same
client ip, and different for different client ips; the limits apply to
each individual value of client ip (strictly: to each individual value of
"key").
 
If "key" is (for example) "fixed", it will be the same for every
connection, and so the limits will apply for all connections.
 
Note: that limits concurrent connections, not requests.
 
> ##########method 2##########
> 
> limit_req_zone $binary_remote_addr zone=one:10m rate=10r/s;
 
http://nginx.org/r/limit_req_zone
 
Again, set "key" to something that is the same for all requests, and
the limit will apply to all requests.
 
f
-- 
Francis Daly        [email protected]
_______________________________________________
nginx mailing list
[email protected]
http://mailman.nginx.org/mailman/listinfo/nginx
_______________________________________________
nginx mailing list
[email protected]
http://mailman.nginx.org/mailman/listinfo/nginx

Reply via email to