Welcome! Log In Create A New Profile

Advanced

limit_req inside a if block - Not allowed ?

Harish Sundararaj
April 15, 2010 06:56AM
Hi all,

My objective is to apply the limit_req for all requests except Googlebot.,
So had something like this inside a location context:


limit_req_zone $binary_remote_addr zone=one:2m rate=25r/m; #This piece
of conf is inside a http context

#The below code is inside a location context

if ($http_user_agent !~ Googlebot) {
limit_req zone=one burst=4;
}

But I get a error :
[emerg]: "limit_req" directive is not allowed here

Is there anyway i can achieve this ?

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

limit_req inside a if block - Not allowed ?

Harish Sundararaj April 15, 2010 06:56AM

Re: limit_req inside a if block - Not allowed ?

Maxim Dounin April 15, 2010 08:54PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 177
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 500 on July 15, 2024
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready