Skip to main content
Version: 0.10.0-dev

Routes

Each service contains one or more routes. A route matches incoming requests by hostname and path prefix.

routes = [
{
# Match requests for these hostnames.
hosts = ["example.com", "www.example.com"]

# Match requests with this path prefix.
path = "/api"
},
{
hosts = ["example.com"]
path = "/ws"

# Enable WebSocket upgrades on this route.
enable_websocket = true
ws_max_connections = 10000
}
]

Fields

FieldTypeDefaultDescription
hostslist(string)(required)The list of hostnames this route applies to. Requests are only matched if the Host header matches one of the specified values. Use ["*"] to match all hostnames.
pathstring(required)The URL path prefix to match. Must start with / and must be unique across all routes.
enable_websocketbooleanfalseEnables WebSocket upgrades for this route.
ws_max_connectionsinteger(optional)The maximum number of concurrent WebSocket connections allowed for this route.