Limit number of requests per second
This commit is contained in:
parent
0b6c7e1755
commit
1c061d1899
|
@ -47,12 +47,12 @@ http {
|
|||
aio threads;
|
||||
aio_write on;
|
||||
|
||||
#limit_conn_zone $binary_remote_addr zone=limit_per_ip:10m;
|
||||
#limit_conn limit_per_ip 128;
|
||||
#limit_req_zone $binary_remote_addr zone=allips:10m rate=150r/s;
|
||||
#limit_req zone=allips burst=150 nodelay;
|
||||
|
||||
limit_req_zone $binary_remote_addr zone=lufilimit:10m rate=10r/s;
|
||||
{% if nginx_limit_req is defined %}
|
||||
limit_req zone=limitreqsbyaddr burst=20 delay;
|
||||
limit_req_status 429;
|
||||
limit_req_log_level warn;
|
||||
limit_req_zone $binary_remote_addr zone=limitreqsbyaddr:20m rate=10r/s sync;
|
||||
{% endif %}
|
||||
|
||||
gzip {{ nginx_gzip | default("off")}};
|
||||
gzip_comp_level 6;
|
||||
|
|
Loading…
Reference in New Issue