Skip to main content

Routes

A route is a unique routing rule based on hostname, path, method and headers that will execute a chain of plugins and eventually forward the request to the backend application.

UI page

You can find all routes here

Properties

PropertyTypeDefaultDescription
idstringUnique identifier of the route
namestringDisplay name of the route
descriptionstringDescription of the route
tagsarray of string[]Tags for categorization and API automation
metadataobject{}Key/value metadata. Some keys are reserved
enabledbooleantrueWhether the route is active. Disabled routes are ignored by the router
debug_flowbooleanfalseEnable debug flow. Execution reports will contain all input/output values. See engine docs
capturebooleanfalseEnable request/response capture. Generates events with full request content. Use with caution! See engine docs
export_reportingbooleanfalseExport execution reports for each request via data exporters. See engine docs
groupsarray of string["default"]Service groups this route belongs to. Used for API key authorization
bound_listenersarray of string[]List of HTTP listener IDs this route is bound to. When a listener is exclusive, only bound routes are served on its port
frontendobjectFrontend configuration (how the router matches this route). See below
backendobjectBackend configuration (where to forward requests). See backends
backend_refstringnullReference to a global stored backend by ID. If set, takes precedence over inline backend
pluginsobjectPlugin chain configuration. See below

Reserved metadata

Some metadata keys are reserved for Otoroshi internal use:

KeyDescription
otoroshi-core-user-facingIs this a user-facing app for the Snow Monkey
otoroshi-core-use-akka-http-clientUse the pure Akka HTTP client
otoroshi-core-use-netty-http-clientUse the pure Netty HTTP client
otoroshi-core-use-akka-http-ws-clientUse the modern WebSocket client
otoroshi-core-issue-lets-encrypt-certificateEnable Let's Encrypt certificate issuance for this route (true/false)
otoroshi-core-issue-certificateEnable certificate issuance for this route (true/false)
otoroshi-core-issue-certificate-caID of the CA cert to generate the certificate
otoroshi-core-openapi-urlOpenAPI spec URL for this route
otoroshi-core-envEnvironment for this route (legacy)
otoroshi-deployment-providersRelay routing: infrastructure providers
otoroshi-deployment-regionsRelay routing: network regions
otoroshi-deployment-zonesRelay routing: network zones
otoroshi-deployment-dcsRelay routing: datacenters
otoroshi-deployment-racksRelay routing: racks

Frontend configuration

The frontend defines how the Otoroshi router matches incoming requests to this route.

PropertyTypeDefaultDescription
domainsarray of string[]Matched domains and paths. Supports wildcards in domain and path, and named path params (e.g., api.oto.tools/users/$id<[0-9]+>)
strip_pathbooleantrueStrip the matched path from the forwarded request
exactbooleanfalsePerform exact path matching. If false, matches on /path*
headersobject{}Required HTTP headers to match. If empty, any headers match
queryobject{}Required query parameters to match. If empty, any query params match
cookiesobject{}Required cookies to match. If empty, any cookies match
methodsarray of string[]Allowed HTTP methods. If empty, any method matches

For more information about routing, check the engine documentation.

Frontend JSON example

{
"domains": [
"api.oto.tools/users"
],
"strip_path": true,
"exact": false,
"headers": {},
"query": {},
"cookies": {},
"methods": ["GET", "POST"]
}

Backend configuration

The backend field defines the target servers to forward requests to. For detailed documentation, see backends.

Alternatively, use backend_ref to reference a global stored backend by ID, making the backend reusable across multiple routes.

Plugins

The plugins field contains the list of plugins applied on this route. Each plugin definition has the following structure:

PropertyTypeDefaultDescription
enabledbooleantrueWhether the plugin is active
debugbooleanfalseEnable debug output for this specific plugin
pluginstringThe plugin identifier (e.g., cp:otoroshi.next.plugins.Redirection)
includearray of string[]Path patterns to include. If empty, all paths are included
excludearray of string[]Path patterns to exclude. If empty, no paths are excluded
configobject{}Plugin-specific configuration
plugin_indexobjectnullExplicit plugin execution order. If not provided, array order is used
bound_listenersarray of string[]Listener-specific plugin binding

Plugin JSON example

{
"enabled": true,
"debug": false,
"plugin": "cp:otoroshi.next.plugins.Redirection",
"include": [],
"exclude": [],
"config": {
"code": 303,
"to": "https://www.otoroshi.io"
},
"plugin_index": {
"pre_route": 0
}
}

For the full list of available plugins, see built-in plugins.

Complete route JSON example

{
"id": "route_users_api",
"name": "Users API",
"description": "Route for the users microservice",
"tags": ["users", "api"],
"metadata": {},
"enabled": true,
"debug_flow": false,
"capture": false,
"export_reporting": false,
"groups": ["default"],
"bound_listeners": [],
"frontend": {
"domains": ["api.oto.tools/users"],
"strip_path": true,
"exact": false,
"headers": {},
"query": {},
"cookies": {},
"methods": []
},
"backend": {
"targets": [
{
"id": "target_1",
"hostname": "users-service.internal",
"port": 8080,
"tls": false,
"weight": 1,
"protocol": "HTTP/1.1"
}
],
"root": "/",
"rewrite": false,
"load_balancing": { "type": "RoundRobin" }
},
"backend_ref": null,
"plugins": {
"slots": [
{
"plugin": "cp:otoroshi.next.plugins.OverrideHost",
"enabled": true,
"include": [],
"exclude": [],
"config": {}
}
]
}
}

Admin API

GET    /api/routes           # List all routes
POST /api/routes # Create a route
GET /api/routes/:id # Get a route
PUT /api/routes/:id # Update a route
DELETE /api/routes/:id # Delete a route
PATCH /api/routes/:id # Partially update a route