Sail

Routing

Routes define how incoming requests are matched and forwarded to backend clusters.

Route Configuration

A route consists of a match pattern and a destination cluster.

{
  "routeId": "api-route",
  "clusterId": "backend-cluster",
  "match": {
    "path": "/api/{**catch-all}"
  },
  "order": 1
}

Match Patterns

Path Matching

"/api/users"

Exact path match

"/api/{**catch-all}"

Catch-all pattern (matches /api/anything/here)

"/users/{id}"

Parameter match (e.g., /users/123)

Header Matching

{
  "match": {
    "path": "/api/{**catch-all}",
    "headers": [
      {
        "name": "X-API-Version",
        "values": ["v2"],
        "mode": "ExactHeader"
      }
    ]
  }
}

Host Matching

{
  "match": {
    "hosts": ["api.example.com", "*.example.com"]
  }
}

Query Parameter Matching

{
  "match": {
    "path": "/api/{**catch-all}",
    "queryParameters": [
      {
        "name": "version",
        "values": ["2"],
        "mode": "Exact"
      }
    ]
  }
}

Route Priority

Routes are evaluated based on the order property. Lower values have higher priority.

Important: More specific routes should have lower order values to be evaluated first.

See also