Welcome! Log In Create A New Profile

Advanced

limit_req with IP whitelisting

July 06, 2011 12:27PM
Hi folks,

1)
I want to use limit_req with whitelisting some subnet, I have seen this post: http://forum.nginx.org/read.php?21,200815,200815#msg-200815 and done some test but it's not working.

I have added to server context:

geo $rate {
default 5; # 5r/s
10.0.0.0/24 -;
192.168.0.0/24 -;
10.1.0.0 -;
}

limit_req_zone $binary_remote_addr zone=ratezone:10m rate=$rate;
limit_req zone=ratezone burst=10 nodelay;

And I receive as error: nginx: [emerg] invalid rate "rate=$rate"

Any idea how to fix this issue?


2) Is it possible to use limit_req for a single domaine "$host"?


Thanks in advance.

---
Matt
Subject Author Posted

limit_req with IP whitelisting

LeMaitre July 06, 2011 12:27PM

Re: limit_req with IP whitelisting

Maxim Dounin July 06, 2011 01:28PM

Re: limit_req with IP whitelisting

LeMaitre July 06, 2011 02:43PM

Re: limit_req with IP whitelisting

LeMaitre July 06, 2011 06:39PM

Re: limit_req with IP whitelisting

António P. P. Almeida July 06, 2011 03:02PM

Re: limit_req with IP whitelisting

Maxim Dounin July 06, 2011 03:10PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 232
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