# HTTPLimitRequest Module: Whitelisting IPs

**URL:** <https://www.ruby-forum.com/t/httplimitrequest-module-whitelisting-ips/204859>\
**Category:** NGINX\
**Created:** [March 23, 2011, 2:31pm UTC](https://www.ruby-forum.com/t/httplimitrequest-module-whitelisting-ips/204859 "2011-03-23T14:31:51Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![luislavena](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/0ea827/32.png) [@luislavena](https://www.ruby-forum.com/u/luislavena)\
**Post date:** [March 23, 2011, 2:31pm UTC](https://www.ruby-forum.com/t/httplimitrequest-module-whitelisting-ips/204859/1 "2011-03-23T14:31:51Z")

</div>

Hello,

I am trying to use the HTTPLimitRequests Module to prevent excessive  
usage of resources on our server. However we also have some spikes which  
seem to originate from search bots or other allowed usage. We want to  
keep these requests from known IP adresses untouched and limit all other  
requests.

Is there a way to whitelist IPs using this module?

Thank you for your answer!

Best regards,  
Jonas Kaufmann

Posted at Nginx Forum:

> **[HTTPLimitRequest Module: Whitelisting IPs](https://forum.nginx.org/read.php?2,185127,185127#msg-185127)**
>
> Hello, I am trying to use the HTTPLimitRequests Module to prevent excessive usage of resources on our server. However we also have some spikes which seem to originate from search bots or other allowed usage. We want to keep these requests from known...

---

<div class="post-metadata">

**Author:** ![j0nes2k](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/6bbea6/32.png) [@j0nes2k](https://www.ruby-forum.com/u/j0nes2k)\
**Post date:** [March 25, 2011, 6:25am UTC](https://www.ruby-forum.com/t/httplimitrequest-module-whitelisting-ips/204859/2 "2011-03-25T06:25:54Z")

</div>

Maybe you can use the map module([Module ngx\_http\_map\_module](http://wiki.nginx.org/HttpMapModule)) in  
front of the limit request module.

2011/3/23 j0nes2k [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)

---

<div class="post-metadata">

**Author:** ![j0nes2k](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/6bbea6/32.png) [@j0nes2k](https://www.ruby-forum.com/u/j0nes2k)\
**Post date:** [March 30, 2011, 11:43pm UTC](https://www.ruby-forum.com/t/httplimitrequest-module-whitelisting-ips/204859/3 "2011-03-30T23:43:23Z")

</div>

Were you able to figure out a way to do this? I am in the same  
situation, I would like to whitelist internal IPs as well as some bots.  
Our limit\_req is in the same block as a fastcgi backend, so all requests  
that hit fastcgi go through this block. I tried the if ($condition)  
{limit\_req} but this wasn’t allowed by nginx.

## j0nes2k Wrote:

> Is there a way to whitelist IPs using this module?
> 
> Thank you for your answer!
> 
> Best regards,  
> Jonas Kaufmann

Posted at Nginx Forum:  
[http://forum.nginx.org/read.php?2,185127,187001#msg-187001](http://forum.nginx.org/read.php?2,185127,187001#msg-187001)

---

<div class="post-metadata">

**Author:** ![j0nes2k](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/6bbea6/32.png) [@j0nes2k](https://www.ruby-forum.com/u/j0nes2k)\
**Post date:** [March 31, 2011, 10:59am UTC](https://www.ruby-forum.com/t/httplimitrequest-module-whitelisting-ips/204859/4 "2011-03-31T10:59:44Z")

</div>

Hello,

I have not tried this yet, however I have found another post with a  
possible solution:

> <https://serverfault.com/questions/177461/how-to-rate-limit-in-nginx-but-including-excluding-certain-ip-addresses>

Please let us know if you succeeded in whitelisting IPs, and I will also  
report back if I find a working solution.

Best regards,  
Jonas Kaufmann

Posted at Nginx Forum:

> **[Re: HTTPLimitRequest Module: Whitelisting IPs](https://forum.nginx.org/read.php?2,185127,187064#msg-187064)**
>
> Hello, I am trying to use the HTTPLimitRequests Module to prevent excessive usage of resources on our server. However we also have some spikes which seem to originate from search bots or other allowed usage. We want to keep these requests from known...
