# Request processing rate and reverse proxy

**URL:** <https://www.ruby-forum.com/t/request-processing-rate-and-reverse-proxy/244166>\
**Category:** NGINX\
**Created:** [February 29, 2016, 5:06pm UTC](https://www.ruby-forum.com/t/request-processing-rate-and-reverse-proxy/244166 "2016-02-29T17:06:23Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Rafa\_F](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/958977/32.png) [@Rafa\_F](https://www.ruby-forum.com/u/Rafa_F)\
**Post date:** [February 29, 2016, 5:06pm UTC](https://www.ruby-forum.com/t/request-processing-rate-and-reverse-proxy/244166/1 "2016-02-29T17:06:23Z")

</div>

Hello,

I have setup nginx 1.9.3 as a reverse proxy [1] with a rate limitation  
per  
server [2]. The rate limitation does not work on this scenario. The rate  
request limitation works well if I use nginx as a normal webserver (for  
example to serve the default welcome page).

I have attached my configuration files (listen on 80 and redirect to  
another webserver running lighttpd).

[1] [Module ngx\_http\_proxy\_module](http://nginx.org/en/docs/http/ngx_http_proxy_module.html#proxy_pass)  
[2] [Module ngx\_http\_limit\_req\_module](http://nginx.org/en/docs/http/ngx_http_limit_req_module.html)

Best Regards,  
poiuytrez

PS : You can run it in a docker using the following commands if you  
need:

docker run --rm --name nginx -p 8082:80 -v  
/yourdir/nginx.conf:/etc/nginx/nginx.conf:ro -v  
/yourdir/default.conf:/etc/nginx/conf.d/default.conf --link  
backend:backend  
nginx

docker run --rm --name backend -p 8081:80 jprjr/lighttpd

Go to [http://localhost:8082/](http://localhost:8082/) in your web browser.

---

<div class="post-metadata">

**Author:** ![Guillaume\_Charhon](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/9fc348/32.png) [@Guillaume\_Charhon](https://www.ruby-forum.com/u/Guillaume_Charhon)\
**Post date:** [March 2, 2016, 11:25am UTC](https://www.ruby-forum.com/t/request-processing-rate-and-reverse-proxy/244166/2 "2016-03-02T11:25:55Z")

</div>

Hello guys,

Is it a bug, something not implemented or a mistake on my side?

Best,

On Mon, Feb 29, 2016 at 5:05 PM, Guillaume Charhon \<

---

<div class="post-metadata">

**Author:** ![Guillaume\_Charhon](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/9fc348/32.png) [@Guillaume\_Charhon](https://www.ruby-forum.com/u/Guillaume_Charhon)\
**Post date:** [March 2, 2016, 1:29pm UTC](https://www.ruby-forum.com/t/request-processing-rate-and-reverse-proxy/244166/3 "2016-03-02T13:29:10Z")

</div>

Hello!

On Mon, Feb 29, 2016 at 05:05:16PM +0100, Guillaume Charhon wrote:

> I have setup nginx 1.9.3 as a reverse proxy [1] with a rate limitation per  
> server [2]. The rate limitation does not work on this scenario. The rate  
> request limitation works well if I use nginx as a normal webserver (for  
> example to serve the default welcome page).
> 
> I have attached my configuration files (listen on 80 and redirect to  
> another webserver running lighttpd).

There is no “limit\_req” directive anywhere in your config, so it’s  
not a surprise rate limiting does not work.

You have to configure both “limit\_req\_zone” (to configure shared  
memory zone to store states) and “limit\_req” (to configure  
particular limits in particular locations), see  
details here:

> **[Module ngx\_http\_limit\_req\_module](http://nginx.org/en/docs/http/ngx_http_limit_req_module.html)**

–  
Maxim D.

> **[nginx](http://nginx.org/)**

---

<div class="post-metadata">

**Author:** ![Guillaume\_Charhon](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/9fc348/32.png) [@Guillaume\_Charhon](https://www.ruby-forum.com/u/Guillaume_Charhon)\
**Post date:** [March 3, 2016, 10:12am UTC](https://www.ruby-forum.com/t/request-processing-rate-and-reverse-proxy/244166/4 "2016-03-03T10:12:16Z")

</div>

Hello Maxim,

You are completely right. I must have been completely tired to miss it.

Thank you,  
Guillaume
