Quantcast
Channel: Nginx Forum - Nginx Mailing List - English
Viewing all articles
Browse latest Browse all 7229

limit_conn module exclude also on Maxim Dunin recommended code (no replies)

$
0
0
Hi

I am using this code to limit requests and exclude some ip's"

http {

limit_req_zone $limit zone=delta:8m rate=60r/s;

geo $limited {
default 1;
192.168.45.56/32 0;
199.27.128.0/21 0;
173.245.48.0/20 0;
}

map $limited $limit {
1 $binary_remote_addr;
0 "";
}


And this on the domain config:

server {

limit_req zone=delta burst=90 nodelay;


Now i have two questions:

1)Does nginx realy knows how to exclude ip's in this format .0/21 or i must use them as 199.27.128.5 for example?

199.27.128.0/21

2)Now i want to use the limit_conn_zone on the above recommendation from Maxim Dunin...

like this:

http {

limit_conn_zone $binary_remote_addr zone=alpha:8m;
limit_req_zone $limit zone=delta:8m rate=60r/s;

geo $limited {
default 1;
192.168.45.56/32 0;
199.27.128.0/21 0;
173.245.48.0/20 0;
}

map $limited $limit {
1 $binary_remote_addr;
0 "";
}


And this on the domain config:

server {

limit_conn alpha 20;
limit_req zone=delta burst=90 nodelay;

But how i can use the above exclude list for the limit_conn module also?

Thanks

Viewing all articles
Browse latest Browse all 7229

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>