"limit_req_zone" unknown directive

Hello,

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

nginx version: nginx/0.8.53
TLS SNI support enabled
configure arguments: --conf-path=/etc/nginx/nginx.conf
–error-log-path=/var/log/nginx/error.log --pid-path=/var/run/nginx.pid
–lock-path=/var/lock/nginx.lock
–http-log-path=/var/log/nginx/access.log
–http-client-body-temp-path=/var/lib/nginx/body
–http-proxy-temp-path=/var/lib/nginx/proxy
–http-fastcgi-temp-path=/var/lib/nginx/fastcgi --with-debug
–with-http_stub_status_module --with-http_flv_module
–with-http_ssl_module --with-http_dav_module
–with-http_stub_status_module
–add-module=src/http/modules/http_secure_download_module
–add-module=src/http/modules/http_upload_module
–add-module=src/http/modules/http_uploadprogress_module

Posted at Nginx Forum:
http://forum.nginx.org/read.php?2,145619,145619#msg-145619

Hello!

On Fri, Oct 29, 2010 at 06:33:45AM -0400, TAiS46 wrote:

}

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.

Maxim D.

Maxim D. Wrote:

}
[…]
http://nginx.org/mailman/listinfo/nginx
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;

}

Tanks, Simon

Posted at Nginx Forum:
http://forum.nginx.org/read.php?2,145619,145641#msg-145641

Hello!

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

limit_req_zone $binary_remote_addr
Here my output of nginx -V
error_log /var/log/nginx/error.log info;

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 D.

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs