mirror of
https://git.lapiole.org/dani/ansible-roles.git
synced 2025-08-06 08:36:55 +02:00
Update to 2021-12-01 19:13
This commit is contained in:
18
roles/nginx/templates/ansible_conf.d/10-limits.conf.j2
Normal file
18
roles/nginx/templates/ansible_conf.d/10-limits.conf.j2
Normal file
@@ -0,0 +1,18 @@
|
||||
geo $limit {
|
||||
default 1;
|
||||
127.0.0.1 0;
|
||||
{% for ip in trusted_ip | default([]) %}
|
||||
{{ ip }} 0;
|
||||
{% endfor %}
|
||||
{% for ip in nginx_dos_whitelisted_ip | default([])%}
|
||||
{{ ip }} 0;
|
||||
{% endfor %}
|
||||
}
|
||||
|
||||
map $limit $limit_key {
|
||||
0 "";
|
||||
1 $binary_remote_addr;
|
||||
}
|
||||
|
||||
limit_req_zone $limit_key zone=limit_req_std:3m rate={{ nginx_req_per_sec }}r/s;
|
||||
limit_conn_zone $limit_key zone=limit_conn_std:3m;
|
Reference in New Issue
Block a user