limit_req_zone: How to apply only to some requests containing some string in the URL?

Jader H. Silva jaderhs5 at gmail.com
Fri Oct 25 17:58:40 UTC 2013


Hi,

you could use a map that matches all cases to empty string and default
value as non-empty

map $arg_capacity $my_default_key{~*([2-9]|10)X ""; default
$http_x_forwarded_for;}

If it matches 2X to 10X, $my_default_key will be empty.

Cheers
Jader H. Silva


2013/10/25 Brian08275660 <nginx-forum at nginx.us>

> Hi Francis,
>
> Now I need to create a limit that acts if the parameter ("capacity") is
> empty (not provided). How do I do that? I can't find how to, at least not
> using "map".
> (If provided, the other rules will evaluate it and one of them will act
> according to the value).
>
> Thanks in advanced!
>
> Posted at Nginx Forum:
> http://forum.nginx.org/read.php?2,244015,244123#msg-244123
>
> _______________________________________________
> nginx mailing list
> nginx at nginx.org
> http://mailman.nginx.org/mailman/listinfo/nginx
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.nginx.org/pipermail/nginx/attachments/20131025/6cae043e/attachment.html>


More information about the nginx mailing list