negation in the map directive of nginx

libresco_27 nginx-forum at
Thu Sep 8 17:25:20 UTC 2022


I'm working on rate limiting for specific group of client ids where if the
client id is equal to XYZ don't map it, thus, the zone doesn't get

For ex - 
limit_req_zone $default_rate_client_id zone=globalClientRateLimit_zone:50k
rate=10r/m sync;
map $client_id $default_rate_client_id {
    "^(?!ZZZZZZ)$" "$1" 

But this doesn't seem to work. Is this the correct way to negate a
particular string(ZZZZZ in this example)? Please let me know.


Posted at Nginx Forum:,295157,295157#msg-295157

More information about the nginx mailing list