Configuration

configobject
Hide Child Parameters
daynumber

The number of HTTP requests that can be made per day.

>= 0

error_codenumber

Set a custom error code to return when the rate limit is exceeded.

Default:429

>= 0

error_messagestring

Set a custom error message to return when the rate limit is exceeded.

Default:API rate limit exceeded

fault_tolerantboolean

A boolean value that determines if the requests should be proxied even if Kong has troubles connecting a third-party data store. If true, requests will be proxied anyway, effectively disabling the rate-limiting function until the data store is working again. If false, then the clients will see 500 errors.

Default:true

header_namestring

A string representing an HTTP header name.

hide_client_headersboolean

Optionally hide informative response headers.

Default:false

hournumber

The number of HTTP requests that can be made per hour.

>= 0

limit_bystring

The entity that is used when aggregating the limits.

Allowed values:consumerconsumer-groupcredentialheaderippathservice

Default:consumer

minutenumber

The number of HTTP requests that can be made per minute.

>= 0

monthnumber

The number of HTTP requests that can be made per month.

>= 0

pathstring

A string representing a URL path, such as /path/to/resource. Must start with a forward slash (/) and must not contain empty segments (i.e., two consecutive forward slashes).

policystring

The rate-limiting policies to use for retrieving and incrementing the limits.

Allowed values:clusterlocalredis

Default:local

>= 0 characters

redisobject

Redis configuration

Hide Child Parameters
databaseinteger

Database to use for the Redis connection when using the redis strategy

Default:0

hoststring

A string representing a host name, such as example.com.

passwordstring

Password to use for Redis connections. If undefined, no AUTH commands are sent to Redis.
This field is encrypted.
This field is referenceable.

>= 0 characters

portinteger

An integer representing a port number between 0 and 65535, inclusive.

Default:6379

>= 0<= 65535

server_namestring

A string representing an SNI (server name indication) value for TLS.

sslboolean

If set to true, uses SSL to connect to Redis.

Default:false

ssl_verifyboolean

If set to true, verifies the validity of the server SSL certificate. If setting this parameter, also configure lua_ssl_trusted_certificate in kong.conf to specify the CA (or server) certificate used by your Redis server. You may also need to configure lua_ssl_verify_depth accordingly.

Default:false

timeoutinteger

An integer representing a timeout in milliseconds. Must be between 0 and 2^31-2.

Default:2000

>= 0<= 2147483646

usernamestring

Username to use for Redis connections. If undefined, ACL authentication won’t be performed. This requires Redis v6.0.0+. To be compatible with Redis v5.x.y, you can set it to default.
This field is referenceable.

secondnumber

The number of HTTP requests that can be made per second.

>= 0

sync_ratenumber

How often to sync counter data to the central data store. A value of -1 results in synchronous behavior.

Default:-1

yearnumber

The number of HTTP requests that can be made per year.

>= 0

consumerobject

If set, the plugin will activate only for requests where the specified has been authenticated. (Note that some plugins can not be restricted to consumers this way.). Leave unset for the plugin to activate regardless of the authenticated Consumer.

* Additional properties are NOT allowed.
Hide Child Parameters
idstring
consumer_groupobject

If set, the plugin will activate only for requests where the specified consumer group has been authenticated. (Note that some plugins can not be restricted to consumers groups this way.). Leave unset for the plugin to activate regardless of the authenticated Consumer Groups

* Additional properties are NOT allowed.
Hide Child Parameters
idstring
protocolsarray[string]

A set of strings representing HTTP protocols.

Allowed values:grpcgrpcshttphttps

Default:grpc, grpcs, http, https

routeobject

If set, the plugin will only activate when receiving requests via the specified route. Leave unset for the plugin to activate regardless of the route being used.

* Additional properties are NOT allowed.
Hide Child Parameters
idstring
serviceobject

If set, the plugin will only activate when receiving requests via one of the routes belonging to the specified Service. Leave unset for the plugin to activate regardless of the Service being matched.

* Additional properties are NOT allowed.
Hide Child Parameters
idstring

Did this doc help?

Something wrong?

Help us make these docs great!

Kong Developer docs are open source. If you find these useful and want to make them better, contribute today!