limit_req with IP whitelisting

LeMaitre nginx-forum at nginx.us
Wed Jul 6 20:27:57 MSD 2011


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

Posted at Nginx Forum: http://forum.nginx.org/read.php?2,211989,211989#msg-211989




More information about the nginx mailing list