Welcome! Log In Create A New Profile

Advanced

Re: "limit_req_zone" unknown directive

Maxim Dounin
October 29, 2010 07:48AM
Hello!

On Fri, Oct 29, 2010 at 07:28:07AM -0400, TAiS46 wrote:

> Maxim Dounin Wrote:
> -------------------------------------------------------
> > Hello!
> >
> > On Fri, Oct 29, 2010 at 06:33:45AM -0400, TAiS46
> > wrote:
> >
> > > i have added to my nginx.conf
> > >
> > > http {
> > > limit_req_zone $binary_remote_addr
> > zone=antiddos:10m rate=10r/s;
> > > }
> > >
> > > And in my site config
> > >
> > > location ~ \.php$ {
> > > #limit_req zone=antiddos burst=5;
> > > }
> > >
> > > But i am only getting the error in the topic.
> > > Here my output of nginx -V
> >
> > [...]
> >
> > Most likely reason is that you've added
> > limit_req_zone outside of
> > http{} block. Please show full config.
>
> user www-data;
> worker_processes 16;
>
> error_log /var/log/nginx/error.log info;
> pid /var/run/nginx.pid;
>
> events {
> worker_connections 2048;
> }
>
> http {
> client_max_body_size 1600m;
> include /etc/nginx/mime.types;
> default_type application/octet-stream;
>
> access_log off;
>
> sendfile on;
> #tcp_nopush on;
>
> keepalive_timeout 0;
> #keepalive_timeout 65;
> tcp_nodelay on;
>
> gzip off;
>
> include /etc/nginx/conf.d/*.conf;
> include /etc/nginx/sites-enabled/*;
>
> limit_req_zone $binary_remote_addr zone=one:10m rate=10r/s;
> }

Most likely you have syntax error in one of your include files,
e.g. extra "}" which moves limit_req_zone outside of http{} block.

Note well: you have to define limit_req_zone before you use it
limit_req, so after fixing syntax error you'll see error message
like

[emerg]: unknown limit_req_zone "one" in ...

I.e. moving limit_req_zone before includes is required.

Maxim Dounin

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

"limit_req_zone" unknown directive

TAiS46 October 29, 2010 06:33AM

Re: "limit_req_zone" unknown directive

Maxim Dounin October 29, 2010 07:00AM

Re: "limit_req_zone" unknown directive

TAiS46 October 29, 2010 07:28AM

Re: "limit_req_zone" unknown directive

Maxim Dounin October 29, 2010 07:48AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

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