Welcome! Log In Create A New Profile

Advanced

Re: negation in the map directive of nginx

Francis Daly
September 11, 2022 06:58PM
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 {
> ZZZZZ "";
> $client_id $client_id;

Probably you want "default" there as the first word on the last line.

> When I try to hit the gateway with ZZZZ client_id, it still limits the
> requests according to 3rpm configuration. Am I doing this wrong?

The map has 5 Zs. Your example has 4 Zs.

But more interestingly: $client_id is not a standard nginx variable. How
is it being set; and what test are you running?

Presumably somewhere else in your config you have a "limit_req" directive,
so that you can see the delay between responses.

Cheers,

f
--
Francis Daly francis@daoine.org
_______________________________________________
nginx mailing list -- nginx@nginx.org
To unsubscribe send an email to nginx-leave@nginx.org
Subject Author Posted

negation in the map directive of nginx

libresco_27 September 08, 2022 01:25PM

Re: negation in the map directive of nginx

Francis Daly September 08, 2022 06:56PM

Re: negation in the map directive of nginx

libresco_27 September 11, 2022 11:22AM

Re: negation in the map directive of nginx

Francis Daly September 11, 2022 06:58PM

Re: negation in the map directive of nginx

teodorescu.serban September 09, 2022 02:53AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 132
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready