Kong · Schema

Kong Gateway Route

A Route defines rules to match client requests. Each Route is associated with a Service, and a Service may have multiple Routes. When a request matches a Route, Kong proxies it to the associated Service. Routes support matching on hosts, paths, methods, headers, SNIs, and sources/destinations for stream routing.

API GatewayLuaNGINXOpen Source

Properties

Name Type Description
id string The unique identifier (UUID) of the Route, auto-generated by Kong upon creation.
name string An optional unique human-readable name for the Route. Used for identification and as an alternative to the UUID when referencing the Route in the Admin API.
protocols array An array of the protocols this Route should allow. When set to only https, HTTP requests are answered with an upgrade error. When set to only http, HTTPS requests are answered with a 426 status code.
methods arraynull A list of HTTP methods that match this Route. When using http or https protocols, at least one of methods, hosts, paths, or headers must be set.
hosts arraynull A list of domain names that match this Route. When using http or https protocols, at least one of methods, hosts, paths, or headers must be set. Supports wildcard hostnames using asterisk (*) as a lef
paths arraynull A list of paths that match this Route. When using http or https protocols, at least one of methods, hosts, paths, or headers must be set. Paths can use regex patterns prefixed with a tilde (~).
headers objectnull 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; use the hosts attribute instead.
snis arraynull A list of SNIs that match this Route when using stream routing. When using tcp, tls, or udp protocols, at least one of snis, sources, or destinations must be set.
sources arraynull A list of IP sources of incoming connections that match this Route when using stream routing. Each entry is an object with fields ip and/or port.
destinations arraynull A list of IP destinations of incoming connections that match this Route when using stream routing. Each entry is an object with fields ip and/or port.
https_redirect_status_code integer The status code Kong responds with when all properties of a Route match except the protocol, i.e., if the request protocol is HTTP instead of HTTPS. Applies only when the Route is configured to only a
regex_priority integer A number used to choose which Route resolves a given request when several Routes match it using regex paths simultaneously. Routes with higher regex_priority are evaluated first. Two Routes sharing th
strip_path boolean When matching a Route via one of the paths, strip the matching prefix from the upstream request URL.
path_handling string Controls how the Service path, Route path, and requested path are combined when sending a request to the upstream. Accepted values: v0, v1.
preserve_host boolean 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.
request_buffering boolean 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.
response_buffering boolean 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.
tags arraynull An optional set of strings associated with the Route for grouping and filtering.
service objectnull The Service this Route is associated with. This is where the Route proxies traffic to. Referenced by UUID.
expression stringnull The router expression for the Route when using the expressions router. This field is mutually exclusive with the traditional fields (methods, hosts, paths, headers, snis, sources, destinations).
priority integer The overall priority of the Route used in the expressions router. Routes with higher priority are matched first.
created_at integer Unix epoch timestamp (in seconds) of when the Route entity was created.
updated_at integer Unix epoch timestamp (in seconds) of when the Route entity was last updated.
View JSON Schema on GitHub