Re: negation in the map directive of nginx

2022-09-11 Thread Francis Daly
On Sun, Sep 11, 2022 at 11:22:39AM -0400, libresco_27 wrote: Hi there, > I tried the approach you suggested and it still doesn't seem to work. > This is what I am doing right now :- > > limit_req_zone $default_client_id zone=sample_zone:50k rate=3r/m sync; > map $client_id $default_client_id {

Re: negation in the map directive of nginx

2022-09-11 Thread libresco_27
Thanks Francis for your response. I tried the approach you suggested and it still doesn't seem to work. This is what I am doing right now :- limit_req_zone $default_client_id zone=sample_zone:50k rate=3r/m sync; map $client_id $default_client_id { Z ""; $client_id $client_id;

Re: negation in the map directive of nginx

2022-09-08 Thread teodorescu.serban
If you want to use regexes (to negate) you should use it properly, e.g. start with a "~". See more: http://nginx.org/en/docs/http/ngx_http_map_module.html That said, Francis' idea is a good one. Trying to negate things in regex is quite counterproductive. Posted at Nginx Forum: https://forum.ngin

Re: negation in the map directive of nginx

2022-09-08 Thread Francis Daly
On Thu, Sep 08, 2022 at 01:25:20PM -0400, libresco_27 wrote: Hi there, > 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 > incremented. http://nginx.org/r/limit_req_zone: Requests with an empty key va

negation in the map directive of nginx

2022-09-08 Thread libresco_27
Hi, 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 incremented. For ex - limit_req_zone $default_rate_client_id zone=globalClientRateLimit_zone:50k rate=10r/m sync; map $client_id $default_rate_client_