Welcome! Log In Create A New Profile

Advanced

Re: limit_req seems to have no effect, but I would prefer it did

October 09, 2012 06:16AM
On Tuesday 09 October 2012 13:20:00 zildjohn01 wrote:
> I'm attempting to rate limit requests, and I'm unable to make the limit_req
> directive have any effect. I've trimmed it down to a minimal test case.
> Here's my complete nginx.conf (with only the server_name changed to protect
> the innocent):
>
[...]
> limit_req_zone $binary_remote_addr zone=req_res:10m rate=1r/s;
> limit_req zone=req_res;
>
> server {
> listen 80;
> server_name example.com *.example.com;
> location / {
> return 410;
> }
> }
[...]
>
> Am I missing something obvious here?
>

"return" is a directive from the rewrite module which works on the rewrite
phase. "limit_req" works on the preaccess phase that comes later. So, your
request doesn't reach the limit_req module.

wbr, Valentin V. Bartenev

--
http://nginx.com/support.html

_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
Subject Author Posted

limit_req seems to have no effect, but I would prefer it did

zildjohn01 October 09, 2012 05:20AM

Re: limit_req seems to have no effect, but I would prefer it did

VBart October 09, 2012 06:16AM

Re: limit_req seems to have no effect, but I would prefer it did

zildjohn01 October 10, 2012 09:17PM

Re: limit_req seems to have no effect, but I would prefer it did

VBart October 11, 2012 05:34AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

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