You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
| count | integer | True || > 0 | The maximum number of requests allowed within a given time interval. |
48
-
| time_window | integer | True || > 0 | The time interval corresponding to the rate limiting `count` in seconds. |
47
+
| count | integer | False || > 0 | The maximum number of requests allowed within a given time interval. Required if `rules` is not configured. |
48
+
| time_window | integer | False || > 0 | The time interval corresponding to the rate limiting `count` in seconds. Required if `rules` is not configured. |
49
+
| rules | array[object]| False ||| A list of rate limiting rules. Each rule is an object containing `count`, `time_window`, and `key`. |
50
+
| rules.count | integer | True || > 0 | The maximum number of requests allowed within a given time interval. |
51
+
| rules.time_window | integer | True || > 0 | The time interval corresponding to the rate limiting `count` in seconds. |
52
+
| rules.key | string | True ||| The key to count requests by. If the configured key does not exist, the rule will not be executed. The `key` is interpreted as a combination of variables, for example: `$http_custom_a $http_custom_b`. |
49
53
| key_type | string | False | var |["var","var_combination","constant"]| The type of key. If the `key_type` is `var`, the `key` is interpreted a variable. If the `key_type` is `var_combination`, the `key` is interpreted as a combination of variables. If the `key_type` is `constant`, the `key` is interpreted as a constant. |
50
54
| key | string | False | remote_addr || The key to count requests by. If the `key_type` is `var`, the `key` is interpreted a variable. The variable does not need to be prefixed by a dollar sign (`$`). If the `key_type` is `var_combination`, the `key` is interpreted as a combination of variables. All variables should be prefixed by dollar signs (`$`). For example, to configure the `key` to use a combination of two request headers `custom-a` and `custom-b`, the `key` should be configured as `$http_custom_a $http_custom_b`. If the `key_type` is `constant`, the `key` is interpreted as a constant value. |
51
55
| rejected_code | integer | False | 503 |[200,...,599]| The HTTP status code returned when a request is rejected for exceeding the threshold. |
0 commit comments