Welcome! Log In Create A New Profile

Advanced

limit_conn module exclude also on Maxim Dunin recommended code

January 04, 2015 09:44AM
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
Subject Author Posted

limit_conn module exclude also on Maxim Dunin recommended code

ASTRAPI January 04, 2015 09:44AM

Re: limit_conn module exclude also on Maxim Dunin recommended code

Francis Daly January 07, 2015 06:48PM

Re: limit_conn module exclude also on Maxim Dunin recommended code

ASTRAPI January 08, 2015 12:31PM

Re: limit_conn module exclude also on Maxim Dunin recommended code

Francis Daly January 09, 2015 02:42PM

Re: limit_conn module exclude also on Maxim Dunin recommended code

ASTRAPI January 10, 2015 10:02AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 269
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready