Skip to content

Commit a11ac1a

Browse files
docs: explain invert field in global rate limit example (#9572)
Signed-off-by: Aditya7880900936 <adityasanskarsrivastav788@gmail.com>
1 parent 6bf0e58 commit a11ac1a

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

site/content/en/latest/tasks/traffic/global-rate-limit.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -440,6 +440,8 @@ Here is an example of a rate limit implemented by the application developer to l
440440
value in the `x-user-id` header. Here, user `one` (recognised from the traffic flow using the header `x-user-id` and value `one`) will be rate limited at 3 requests/hour
441441
and so will user `two` (recognised from the traffic flow using the header `x-user-id` and value `two`). But if `x-user-id` is `admin`, it will not be rate limited even beyond 3 requests/hour.
442442

443+
The `invert: true` field inverts the header match condition. Instead of matching requests where `x-user-id` is `admin`, it matches requests where `x-user-id` is **not** `admin`. In this example, the rate limit applies to all distinct users except `admin`.
444+
443445
{{< tabpane text=true >}}
444446
{{% tab header="Apply from stdin" %}}
445447

0 commit comments

Comments
 (0)