I've successfully applied rate-limiting to 1r/s in my Nginx configuration, however I want to implement a function that will apply different rate limit settings (20r/s) for whitelisted IPs. Here are the relevant config settings:
nginx.conf
limit_req_zone $limit zone=all:20m rate=1r/s; domain.conf
geo $whitelist { default 1; 1.1.1.1 0; } map $whitelist $limit { 0 ""; 1 $binary_remote_addr; } limit_req zone=all burst=5; This works as expected, when I whitelist 1.1.1.1, I can access the website without being rate limited at all. How can I implement a limit of 20r/s for the whitelisted IPs? I understand that the solution is not to use 2 zones, but I have read the documentation several times and am at a loss as to how to implement this. Thanks in advance.