On 18 November 2013 20:57, Nam <nginx-fo...@nginx.us> wrote:
> To elaborate a bit more, in a single location I may end up with something
> like this...
>
> set $Whitelisted "No";
> if ($GeoList1 = allow) {
>     set $Whitelisted "Yes";
> }
> if ($GeoList5 = allow) {
>     set $Whitelisted "Yes";
> }
> if ($http_user_agent ~ (googlebot|bingbot)) {
>     set $Whitelisted "Yes";
> }
> if ($Whitelisted ~* "No") {
>     limit_conn conlimit-one 5;
>     limit_req zone=limit-half burst=9;
> }

Have you looked at using map{}s as the limit_* settings' arguments
instead? They're much nicer than sequential if()s, which may not even
achieve what you want to.

J

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

Reply via email to