Route

object

Route entities define rules to match client requests. Every request matching a given route will be proxied to its associated service.

created_atinteger

Unix epoch when the resource was created.

destinationsarray[object]

A list of IP destinations of incoming connections that match this route when using stream routing. Each entry is an object with fields ip (optionally in CIDR range notation) and/or port.

headersobject

One or more lists of values indexed by header name that will cause this route to match if present in the request. The Host header cannot be used with this attribute: hosts should be specified using the hosts attribute. When headers contains only one value and that value starts with the special prefix ~*, the value is interpreted as a regular expression.

hostsarray[string]

A list of domain names that match this route. Note that the hosts value is case sensitive.

Example:foo.example.com

https_redirect_status_codeinteger

The status code Kong responds with when all properties of a route match except the protocol i.e. if the protocol of the request is HTTP instead of HTTPS. Location header is injected by Kong if the field is set to 301, 302, 307 or 308. Note: This config applies only if the route is configured to only accept the https protocol.

Default:426

idstring

Example:56c4566c-14cc-4132-9011-4139fcbbe50a

methodsarray[string]

A list of HTTP methods that match this route.

namestring

The name of the route. Route names must be unique, and they are case sensitive. For example, there can be two different routes named test and Test.

path_handlingstring

Controls how the service path, route path and requested path are combined when sending a request to the upstream. See above for a detailed description of each behavior.

Default:v0

pathsarray[string]

A list of paths that match this route.

preserve_hostboolean

When matching a route via one of the hosts domain names, use the request Host header in the upstream request headers. If set to false, the upstream Host header will be that of the service’s host.

Default:false

protocolsarray[string]

An array of the protocols this route should allow. See the route Object section for a list of accepted protocols. When set to only https, HTTP requests are answered with an upgrade error. When set to only http, HTTPS requests are answered with an error.

Default:http, https

regex_priorityinteger

A number used to choose which route resolves a given request when several routes match it using regexes simultaneously. When two routes match the path and have the same regex_priority, the older one (lowest created_at) is used. Note that the priority for non-regex routes is different (longer non-regex routes are matched before shorter ones).

Default:0

request_bufferingboolean

Whether to enable request body buffering or not. With HTTP 1.1, it may make sense to turn this off on services that receive data with chunked transfer encoding.

Default:true

response_bufferingboolean

Whether to enable response body buffering or not. With HTTP 1.1, it may make sense to turn this off on services that send data with chunked transfer encoding.

Default:true

serviceobject

The service this route is associated to. This is where the route proxies traffic to.

* Additional properties are NOT allowed.
Show Child Parameters
snisarray[string]

A list of SNIs that match this route when using stream routing.

sourcesarray[object]

A list of IP sources of incoming connections that match this route when using stream routing. Each entry is an object with fields ip (optionally in CIDR range notation) and/or port.

strip_pathboolean

When matching a route via one of the paths, strip the matching prefix from the upstream request URL.

Default:true

tagsarray[string]

An optional set of strings associated with the route for grouping and filtering.

updated_atinteger

Unix epoch when the resource was last updated.

Example

SNI

object

An SNI object represents a many-to-one mapping of hostnames to a certificate. That is, a certificate object can have many hostnames associated with it; when Kong receives an SSL request, it uses the SNI field in the Client Hello to lookup the certificate object based on the SNI associated with the certificate.

certificateobject

The id (a UUID) of the certificate with which to associate the SNI hostname. The Certificate must have a valid private key associated with it to be used by the SNI object.

* Additional properties are NOT allowed.
Show Child Parameters
created_atinteger

Unix epoch when the resource was created.

Example:1422386534

idstring

Example:b87eb55d-69a1-41d2-8653-8d706eecefc0

namestring

The SNI name to associate with the given certificate.

Example:my-sni

tagsarray[string]

An optional set of strings associated with the SNIs for grouping and filtering.

Example:user-level, enterprise

Example

Target

object

A target is an ip address/hostname with a port that identifies an instance of a backend service. Every upstream can have many targets, and the targets can be dynamically added, modified, or deleted. Changes take effect on the fly. To disable a target, post a new one with weight=0; alternatively, use the DELETE convenience method to accomplish the same. The current target object definition is the one with the latest created_at.

created_atnumber

Unix epoch when the resource was created.

Example:1422386534

updated_atinteger

Unix epoch when the resource was last updated.

Example:1422386534

idstring

The unique identifier or the name of the upstream for which to update the target.

Example:173a6cee-90d1-40a7-89cf-0329eca780a6

tagsarray[string]

An optional set of strings associated with the Target for grouping and filtering.

targetstring

The target address (ip or hostname) and port. If the hostname resolves to an SRV record, the port value will be overridden by the value from the DNS record.

upstreamobject

The unique identifier or the name of the upstream for which to update the target.

* Additional properties are NOT allowed.
Show Child Parameters
weightinteger

The weight this target gets within the upstream loadbalancer (0-65535). If the hostname resolves to an SRV record, the weight value will be overridden by the value from the DNS record.

Default:100

Example:100

Example

Upstream

object

The upstream object represents a virtual hostname and can be used to loadbalance incoming requests over multiple services (targets). So for example an upstream named service.v1.xyz for a service object whose host is service.v1.xyz. Requests for this service would be proxied to the targets defined within the upstream. An upstream also includes a [health checker][healthchecks], which is able to enable and disable targets based on their ability or inability to serve requests. The configuration for the health checker is stored in the upstream object, and applies to all of its targets.

algorithmstring

Which load balancing algorithm to use.

Default:round-robin

client_certificateobject

If set, the certificate to be used as client certificate while TLS handshaking to the upstream server.

* Additional properties are NOT allowed.
Show Child Parameters
created_atinteger

Unix epoch when the resource was created.

Example:1422386534

updated_atinteger

Unix epoch when the resouce was updated.

Example:1422386534

hash_fallbackstring

What to use as hashing input if the primary hash_on does not return a hash (eg. header is missing, or no Consumer identified). Not available if hash_on is set to cookie.

Default:none

hash_fallback_headerstring

The header name to take the value from as hash input. Only required when hash_fallback is set to header.

hash_fallback_query_argstring

The name of the query string argument to take the value from as hash input. Only required when hash_fallback is set to query_arg.

hash_fallback_uri_capturestring

The name of the route URI capture to take the value from as hash input. Only required when hash_fallback is set to uri_capture.

hash_onstring

What to use as hashing input. Using none results in a weighted-round-robin scheme with no hashing.

Default:none

hash_on_cookiestring

The cookie name to take the value from as hash input. Only required when hash_on or hash_fallback is set to cookie. If the specified cookie is not in the request, Kong will generate a value and set the cookie in the response.

hash_on_cookie_pathstring

The cookie path to set in the response headers. Only required when hash_on or hash_fallback is set to cookie.

Default:/

hash_on_headerstring

The header name to take the value from as hash input. Only required when hash_on is set to header.

hash_on_query_argstring

The name of the query string argument to take the value from as hash input. Only required when hash_on is set to query_arg.

hash_on_uri_capturestring

The name of the route URI capture to take the value from as hash input. Only required when hash_on is set to uri_capture.

healthchecksobject
Show Child Parameters
host_headerstring

The hostname to be used as Host header when proxying requests through Kong.

idstring
namestring

This is a hostname, which must be equal to the host of a service.

slotsinteger

The number of slots in the load balancer algorithm. If algorithm is set to round-robin, this setting determines the maximum number of slots. If algorithm is set to consistent-hashing, this setting determines the actual number of slots in the algorithm. Accepts an integer in the range 10-65536.

Default:10000

tagsarray[string]

An optional set of strings associated with the Upstream for grouping and filtering.

use_srv_nameboolean

If set, the balancer will use SRV hostname(if DNS Answer has SRV record) as the proxy upstream Host.

Default:false

Example

Vault

object

Vault entities are used to configure different Vault connectors. Examples of Vaults are Environment Variables, Hashicorp Vault and AWS Secrets Manager. Configuring a Vault allows referencing the secrets with other entities. For example a certificate entity can store a reference to a certificate and key, stored in a vault, instead of storing the certificate and key within the entity. This allows a proper separation of secrets and configuration and prevents secret sprawl.

configobject

The configuration properties for the Vault which can be found on the vaults’ documentation page.

created_atinteger

Unix epoch when the resource was created.

Example:1422386534

descriptionstring

The description of the Vault entity.

Example:This vault is used to retrieve redis database access credentials

idstring

Example:B2A30E8F-C542-49CF-8015-FB674987D1A5

namestring

The name of the Vault that’s going to be added. Currently, the Vault implementation must be installed in every Kong instance.

Example:env

prefixstring

The unique prefix (or identifier) for this Vault configuration. The prefix is used to load the right Vault configuration and implementation when referencing secrets with the other entities.

Example:env

tagsarray[string]

An optional set of strings associated with the Vault for grouping and filtering.

Example:database-credentials

updated_atinteger

Unix epoch when the resource was last updated.

Example:1422386534

Example