# How to limit\_req depending if the requests has a REFERER or not

**URL:** <https://www.ruby-forum.com/t/how-to-limit-req-depending-if-the-requests-has-a-referer-or-not/218472>\
**Category:** NGINX\
**Created:** [April 2, 2012, 3:32am UTC](https://www.ruby-forum.com/t/how-to-limit-req-depending-if-the-requests-has-a-referer-or-not/218472 "2012-04-02T03:32:22Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![dubstep](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/cdc98d/32.png) [@dubstep](https://www.ruby-forum.com/u/dubstep)\
**Post date:** [April 2, 2012, 3:32am UTC](https://www.ruby-forum.com/t/how-to-limit-req-depending-if-the-requests-has-a-referer-or-not/218472/1 "2012-04-02T03:32:22Z")

</div>

Hello.

I have something like this… I need to be able to apply three different  
limit\_req depending:

a.) If the referer to click.php is [domain.com](http://domain.com) … apply zone1  
b.) If there is some other referer apply zone2 on click.php  
c.) If there is no referer apply zone3 on click.php

location /click.php {  
limit\_req zone=one nodelay;  
proxy\_pass [http://22.136.1.121:80/](http://22.136.1.121:80/);  
}

Mike

---

<div class="post-metadata">

**Author:** ![Micheal\_W](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/ac8455/32.png) [@Micheal\_W](https://www.ruby-forum.com/u/Micheal_W)\
**Post date:** [April 4, 2012, 12:10am UTC](https://www.ruby-forum.com/t/how-to-limit-req-depending-if-the-requests-has-a-referer-or-not/218472/2 "2012-04-04T00:10:11Z")

</div>

Hello.

I have something like this… I need to be able to apply three different  
limit\_req depending:

a.) If the referer to click.php is [domain.com](http://domain.com) … apply zone1  
b.) If there is some other referer apply zone2 on click.php  
c.) If there is no referer apply zone3 on click.php

location /click.php {  
limit\_req zone=one nodelay;  
proxy\_pass [http://22.136.1.121:80/](http://22.136.1.121:80/);  
}

Mike
