June 2, 20232 yr Hi. I'm trying to add rate limiting to the nginx server via froxlor. This seems to mean: At the root of the .conf file is a line: limit_req_zone $binary_remote_addr zone=mylimit:10m rate=10r/s; In each relevant location is a line: limit_req zone=mylimit burst=20 nodelay; By adding the location line to my domains vhost in froxlor it correctly re-generates the .conf file with the 'limit_req' line. However adding the limit_req_zone at the root level in the vhost config via froxlor adds it to the bottom of the .conf file, which causes the nginx server reload/start to fail. I'm manually added it at root level of the .conf file, and nginx restart/reloads with no errors. Is there a way (besides manually editing it on each server restart) to do this with froxlor now? Perhaps an include file with the details (but that would put it outside froxlor's conf file generation)? See nginx example/documentation at http://nginx.org/en/docs/http/ngx_http_limit_req_module.html
June 2, 20232 yr Depends in which context the directive has to be, if it's http{} you can just define it globally in the nginx.conf before the vhosts are included
June 2, 20232 yr Author Thanks! - I tried that and it works fine (once I also add the domain-level directive like: location / { limit_req zone=mylimit burst=20 nodelay; } This will also help me understand how to add other nginx modules...
Create an account or sign in to comment