Hi,
I am currently trying to configure a different rate limit for a specific IP and have tried to configure Nginx around this, however with my configuration below, I keep hitting the default rate limit unless I remove burst from the override zone. How do I configure multiple rate limits with the idea of one of the rates overriding the "default" rate by a specific IP address.
Nginx 1.24 Sample config:
geo $remote_addr $client_rate_limit {
default 1;
123.123.123.123 0;
}
map $client_rate_limit $override_client_rate_limit {
1 "";
0 "$remote_addr";
}
limit_req_zone $uri zone=another_api_rate_limit:64m rate=100r/s;
limit_req_zone $override_client_rate_limit zone=override_web_api_client_rate_limit:64m rate=50r/s;
limit_req_zone $remote_addr zone=client_rate_limit:64m rate=25r/s;
server {
...
limit_req zone=override_web_api_client_rate_limit burst=200;
limit_req zone=another_api_rate_limit burst=500;
limit_req zone=client_rate_limit burst=200;
limit_req_status 429;
location ~* ^/test {
...
}
}
Is there some precedence on what gets applied with multiple rate limits?