limit_req zone=ip_limit burst=20 nodelay; everywere
but 'limit_req_zone $binary_remote_addr zone=ip_limit:10m
rate=2r/s;'
Kluczowe zasady:
Deklaracja limit_req_zone powinna być globalna i pojawiać się tylko
raz.
Użycie limit_req jest lokalne i może być stosowane w wielu
lokalizacjach czy serwerach.
This commit is contained in:
parent
729d749127
commit
701ee703de
|
|
@ -1,5 +1,3 @@
|
|||
limit_req_zone $binary_remote_addr zone=ip_limit:10m rate=2r/s;
|
||||
|
||||
server {
|
||||
|
||||
listen 443 ssl;
|
||||
|
|
@ -16,10 +14,8 @@ server {
|
|||
|
||||
location / {
|
||||
|
||||
# Ograniczenie liczby żądań
|
||||
limit_req zone=ip_limit burst=20 nodelay;
|
||||
|
||||
proxy_pass http://angular-services:8800;
|
||||
limit_req zone=ip_limit burst=10 nodelay;
|
||||
proxy_pass http://angular-services:8800;
|
||||
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
|
|
|
|||
|
|
@ -17,7 +17,10 @@ server {
|
|||
|
||||
|
||||
location / {
|
||||
|
||||
|
||||
# Ograniczenie liczby żądań
|
||||
limit_req zone=ip_limit burst=20 nodelay;
|
||||
|
||||
proxy_pass http://arti-angular-app:4200;
|
||||
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
|
|
|
|||
|
|
@ -1,5 +1,3 @@
|
|||
limit_req_zone $binary_remote_addr zone=ip_limit:10m rate=2r/s;
|
||||
|
||||
server {
|
||||
|
||||
listen 443 ssl;
|
||||
|
|
@ -33,10 +31,10 @@ server {
|
|||
|
||||
location / {
|
||||
|
||||
# Ograniczenie liczby żądań
|
||||
# Ograniczenie liczby żądań
|
||||
limit_req zone=ip_limit burst=20 nodelay;
|
||||
|
||||
proxy_pass http://zaklik_by_node_js:3001;
|
||||
|
||||
proxy_pass http://zaklik_by_node_js:3000; proxy_pass http://zaklik_by_node_js:3001;
|
||||
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
|
|
|
|||
|
|
@ -1,5 +1,3 @@
|
|||
limit_req_zone $binary_remote_addr zone=ip_limit:10m rate=2r/s;
|
||||
|
||||
server {
|
||||
|
||||
listen 443 ssl;
|
||||
|
|
@ -16,9 +14,8 @@ server {
|
|||
|
||||
location / {
|
||||
|
||||
# Ograniczenie liczby żądań
|
||||
# Ograniczenie liczby żądań
|
||||
limit_req zone=ip_limit burst=20 nodelay;
|
||||
|
||||
proxy_pass http://zaklik_by_node_js:3000;
|
||||
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
|
|
|
|||
Loading…
Reference in New Issue