rate_limit
object to the extended_paths
section of your API definition.
The rate_limit
object has the following configuration:
path
: the endpoint pathmethod
: the endpoint HTTP methodenabled
: boolean to enable or disable the rate limitrate
: the maximum number of requests that will be permitted during the interval (window)per
: the length of the interval (window) in secondsrate_limit
objects.
GET
requests to the /anything
endpoint, limiting requests to 60 per
second.
rate_limit
array. For example, if you wanted to limit the rate of
POST
requests to your API allowing a higher rate to one specific
endpoint you could configure the API definition as follows:
POST
requests to /user/login
to 100 requests per second (rps). Any other POST
request matching the
regex pattern /.*
will be limited to 60 requests per second. The order
of evaluation ensures that the specific /user/login
endpoint is matched
and evaluated before the regex pattern.