0
Answered
http limit_req_zone
Hi,
I'm trying to figure how to add a http block with the following for rate limit.
http {
limit_req_zone $binary_remote_addr zone=one:10m rate=1r/s;
}
Tried adding this in /etc/nginx.custom.d/codes.conf - Doesn't work.
Please suggest.
CW
I'm trying to figure how to add a http block with the following for rate limit.
http {
limit_req_zone $binary_remote_addr zone=one:10m rate=1r/s;
}
Tried adding this in /etc/nginx.custom.d/codes.conf - Doesn't work.
Please suggest.
CW
Answer
Answer
Answered
Just paste this line only (limit_req_zone $binary_remote_addr zone=one:10m rate=1r/s;) in your nginx.custom.d/limits.conf file.
See the include directives in /etc/nginx/nginx.conf for more info.
See the include directives in /etc/nginx/nginx.conf for more info.
Thank you.
I just did that and added this directive (limit_req zone=one burst=5 nodelay;) in Advanced under Content section.
Upon restarting nginx I get the following error:
2015/08/05 15:42:18 [emerg] 26250#0: unknown limit_req_zone "one" in /etc/nginx/conf.d/mydomain.conf:31
Thoughts please?
I just did that and added this directive (limit_req zone=one burst=5 nodelay;) in Advanced under Content section.
Upon restarting nginx I get the following error:
2015/08/05 15:42:18 [emerg] 26250#0: unknown limit_req_zone "one" in /etc/nginx/conf.d/mydomain.conf:31
Thoughts please?
Hmm looks like it's relying on zone being defined before being used. In this case, remove your nginx.custom.d file and instead paste the zone definition into Website > Advanced > Custom top-level configuration.
Customer support service by UserEcho
See the include directives in /etc/nginx/nginx.conf for more info.