Skip to content

Commit b185359

Browse files
authored
docs: Update rate limit policy conditions explanation (#1172)
Clarified the conditions for rate limiting in policies, specifying that conditions are optional and detailing the behavior of default policies.
1 parent 568ddf6 commit b185359

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

content/nic/configuration/policy-resource.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -180,10 +180,10 @@ condition:
180180
|``variables`` | defines a Variable condition to rate limit against. | [ratelimit.condition.variables](#ratelimitconditionvariables) | No |
181181
|``default`` | sets the rate limit in this policy to be the default if no conditions are met. In a group of policies with the same condition, only one policy can be the default. | ``bool`` | No |
182182
{{% /table %}}
183-
{{< call-out "note" >}}
184-
185-
One condition of type `jwt` or `variables` is required. Each Policy supports only one condition.
186183

184+
{{< call-out "note" >}}
185+
Conditions (`jwt` or `variables`) are optional, but each policy can only have one.
186+
If conditions are used, a request doesn't match any, and a `default` has been defined, the `default` policy applies. Otherwise, if no `default` is set, the request isn't rate limited.
187187
{{< /call-out >}}
188188

189189
The rate limit policy with condition is designed to be used in combination with one or more rate limit policies. For example, multiple rate limit policies with [RateLimit.Condition.JWT](#ratelimitconditionjwt) can be used to apply different tiers of rate limit based on the value of a JWT claim. For a practical example of tiered rate limiting by the value of a JWT claim, see the example in our [GitHub repository](https://github.com/nginx/kubernetes-ingress/tree/v{{< nic-version >}}/examples/custom-resources/rate-limit-tiered-jwt-claim/README.md).

0 commit comments

Comments
 (0)