Match incoming requests and apply traffic policies before forwarding to a backend.
Routes live inside listeners and define how agentgateway matches and handles incoming HTTP requests. Each route specifies optional matching criteria, an optional set of policies, and the backends to forward matching traffic to.
Additional hostname constraints for this route. Requests must match both the parent listener’s hostname and the route’s hostname. Accepts wildcards, e.g. "*.example.com".When omitted, the route matches any hostname accepted by the listener.
An array of match criteria. A request must satisfy all conditions within a single match object. If multiple match objects are listed, a request matching any one of them qualifies.When matches is omitted entirely, the route matches all requests.
Routes are evaluated in the order they appear in the configuration. The first route whose match conditions are satisfied handles the request — subsequent routes are not evaluated.Routes without a matches block match every request. Place them last to act as a catch-all fallback.
routes: # Most specific — matched first - name: exact-path matches: - path: exact: /api/v2/status backends: - host: status-service:8080 # Less specific — path prefix - name: api-prefix matches: - path: pathPrefix: /api backends: - host: api-service:8080 # Catch-all — matched last - name: default backends: - host: default-service:8080