How to limit POST request per ip ?

Jeroen Ooms jeroen.ooms at stat.ucla.edu
Tue May 6 22:16:09 UTC 2014


On Sat, Apr 5, 2014 at 3:07 PM, Maxim Dounin <mdounin at 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.



More information about the nginx mailing list