Welcome! Log In Create A New Profile

Advanced

Re: How to limit POST request per ip ?

Maxim Dounin
May 09, 2014 12:24AM
Hello!

On Tue, May 06, 2014 at 03:16:09PM -0700, Jeroen Ooms wrote:

> On Sat, Apr 5, 2014 at 3:07 PM, Maxim Dounin <mdounin@mdounin.ru> wrote:
> >
> > we need something like
> >
> > limit_req_zone $limit zone=one:10m rate=1r/s;
> >
> > where the $limit variables is empty for non-POST requests (as we
> > don't want to limit them), and evaluates to $binary_remote_addr
> > for POST requests.
>
> A follow-up question: are requests that hit the cache counted in the
> limit_req_zone? I would like to enforce a limit on the POST requests
> that actually hit the back-end; I don't mind additional requests that
> hit the cache.

Limits are checked (and counted) before a request is passed to a
content handler, hence all requests are counted, both cached and
not. If you want to limit only requests which aren't cached, you
may do so, e.g., by adding an additional proxy layer with
limit_req.

--
Maxim Dounin
http://nginx.org/

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

How to limit POST request per ip ?

justcyber April 05, 2014 07:54AM

Re: How to limit POST request per ip ?

Maxim Dounin April 05, 2014 06:10PM

Re: How to limit POST request per ip ?

Jeroen Ooms May 06, 2014 06:18PM

Re: How to limit POST request per ip ?

Maxim Dounin May 09, 2014 12:24AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

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