Welcome! Log In Create A New Profile

Advanced

Re: Exclude ip's from Nginx limit_req zone

Martin Frb
December 21, 2014 05:52AM
> limit_conn_zone $binary_remote_addr zone=alpha:8m;
> limit_req_zone $binary_remote_addr zone=delta:8m rate=40r/s;
>
> Domain nginx conf:
>
> limit_conn alpha 5;
> limit_req zone=delta burst=80 nodelay;
>
>
> So a user can create only 5 connections per ip and can have 40
> requests with a burst up to 80 connections.
>
> Now i want to exclude Cloudflare ip's from this connection limits.


If memory serves right you can use

location / {
if ($remote_addr != 1.2.3.4) {
error_page 404 = @no_whitelist;
return 404;
}
# whitelisted
}
location @no_whitelist {
limit_conn adalpha 5;
}

_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
Subject Author Posted

Exclude ip's from Nginx limit_req zone

ASTRAPI December 20, 2014 06:18PM

Re: Exclude ip's from Nginx limit_req zone

mex December 21, 2014 05:25AM

Re: Exclude ip's from Nginx limit_req zone

Martin Frb December 21, 2014 05:52AM

Re: Exclude ip's from Nginx limit_req zone

ASTRAPI December 21, 2014 07:17AM

Re: Exclude ip's from Nginx limit_req zone

Francis Daly December 21, 2014 09:42AM

Re: Exclude ip's from Nginx limit_req zone

ASTRAPI December 21, 2014 10:11AM

Re: Exclude ip's from Nginx limit_req zone

B.R. December 21, 2014 11:26AM

Re: Exclude ip's from Nginx limit_req zone

ASTRAPI December 21, 2014 01:36PM

Re: Exclude ip's from Nginx limit_req zone

ASTRAPI December 24, 2014 09:01AM

Re: Exclude ip's from Nginx limit_req zone

Maxim Dounin December 24, 2014 09:34AM

Re: Exclude ip's from Nginx limit_req zone

ASTRAPI December 24, 2014 02:36PM

Re: Exclude ip's from Nginx limit_req zone

Maxim Dounin December 25, 2014 08:14AM

Re: Exclude ip's from Nginx limit_req zone

ASTRAPI December 25, 2014 01:32PM

Re: Exclude ip's from Nginx limit_req zone

ASTRAPI December 29, 2014 05:13PM

Re: Exclude ip's from Nginx limit_req zone

ASTRAPI January 03, 2015 07:35PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 98
Record Number of Users: 6 on February 13, 2018
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready