I think a limit of two connections per address is too low. I know that tip pages suggest a low limit in so-called anti-DDOS (really just flood protection). Some large carriers can generate 30+ connections per IP, probably because they lack sufficient IPV4 address space for their millions of users. This is based on my logs. I used to have a limit of 10 and it was reached quite often just from corporate users. 

The 10 per second rate is fine, and probably about as low as you should go. 

What does 2000 requests mean? Is that per second? 


Sent: November 30, 2017 1:14 AM
Subject: 回复: How to control the total requests in Ngnix

Additional: the total requests will be sent from different client ips.


Tong

 
发件人: [email protected]
发送时间: 2017-11-30 17:12
收件人: nginx
主题: How to control the total requests in Ngnix
Hi guys,

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;

server {

location /mylocation/ {

                            limit_conn addr 2;

                            proxy_pass http://my_server/mylocation/;

                            proxy_set_header Host $host:$server_port;                      

         }

} 

##########method 2##########

limit_req_zone $binary_remote_addr zone=one:10m rate=10r/s;

server {

location /mylocation/ {

                            limit_req zone=one burst=5 nodelay;

                            proxy_pass http://my_server/mylocation/;

                            proxy_set_header Host $host:$server_port;                      

         }

}



How can I do it?



Tong

_______________________________________________
nginx mailing list
[email protected]
http://mailman.nginx.org/mailman/listinfo/nginx

Reply via email to