Hello
I would like to test Nginx limit_req feature. NGINX provides an example
limit_req_zone $binary_remote_addr zone=mylimit:10m rate=10r/s;
server {
location /login/ {
limit_req zone=mylimit;
proxy_pass http://my_upstream;
}
}
So I started with
services.nginx.virtualHosts.<name>.extraConfig
This one seems to works to define limit_req. Then I want to implement the other directive, in the http block, limit_req_zone . Then I am stuck
I tried
appendConfig = " limit_req_zone $binary_remote_addr zone=mylimit:10m rate=10r/s; " ;
But then is added outside of http block. If I use httpConfig then (as warned by documentation) , VirtualHost directives are ignored.
services.nginx = {
enable = true;
#httpConfig = " limit_req_zone $binary_remote_addr zone=mylimit:10m rate=10r/s; " ;
virtualHosts = {
"mydomain.online" = {
forceSSL = true;
enableACME = true;
root = "/var/www/mydomain.online";
extraConfig = "limit_req zone=mylimit;";
};
It seems I could use httpConfig but then the full nginx conf has to be “manual” and I need to renunce my current configuration.nix content regarding vhost… Did I understand properly?