All Products
Search
Document Center

API Gateway:Create a route

Last Updated:Jun 04, 2026

Cloud-native API Gateway evaluates routing rules from highest to lowest priority. If a request matches a rule, the gateway forwards it to the configured backend service. If no rules match, the gateway returns a 404 error.

Route matching priority

When multiple routing rules exist, they are prioritized as follows: Associated Domain Name > Path > Header > Query Parameters > Created At.

  1. Associated Domain Name: Longer domain strings have higher priority.

  2. Path:

    • If the Match Rule differ, the priority is: Equals To > Prefix > Regular Expression Match.

    • If the Match Rule are the same, longer Path values have higher priority.

  3. Header: More key-value pairs mean higher priority.

  4. Query Parameters: More key-value pairs mean higher priority.

  5. Created At: Earlier creation times have higher priority.

Procedure

Note
  • Routes support HTTP/1.0, HTTP/1.1, HTTP/2.0, gRPC, and WebSocket.

  • Routes are scoped to the instance in which they are created.

  1. You can create a route from outside or inside a gateway instance.

    Outside an instance

    1. Log on to the Cloud-native API Gateway console. In the left-side navigation pane, click API, and then select a region.

    2. Click the target API, then select the target instance or All Instances from the drop-down list.image

    3. Click Create Route.

    Inside an instance

    1. Log on to the Cloud-native API Gateway console. In the left-side navigation pane, click Instance, and then select a region.

    2. On the Instance page, click the target gateway instance ID. In the left-side navigation pane, click API, and then click the target API.

    3. Click Create Route.

  2. On the Create Route page, configure the parameters, and then click Save or Save and Publish.

    Note
    • Match conditions use logical AND. More conditions narrow the matching scope.

    • Route priority follows the display order on the configuration page.

    Parameter

    Description

    Route Name

    Custom name for the route.

    Route Description

    Click Add Route Description to add a route description.

    Domain Name

    • Select one or more domains to match.

    • To add a domain, click Add Domain and follow the on-screen instructions.

    Path

    Request path to match.

    • With the same match rule, longer paths have higher priority.

    • With different match rules, the priority is: Equals To > Prefix > Regular Expression Match.

      • Equals To: Matches the exact path, such as /user.

      • Prefix: Matches a path prefix, such as paths starting with /user.

      • Regular Expression Match: Matches a regular expression pattern.

    Method

    HTTP method to match. You can select multiple methods. Default: ANY.

    Header

    Request headers to match.

    Query Parameters

    Query parameters to match.

    Instance

    Gateway instance for this route.

    Scenario

    Backend service type for the route.

    • Basic scenario: Single Service

    • Canary release scenario: By Percentage (Multi-service), Tag (Tag-based Routing)

    • Other scenarios: Mock, Redirect

    Backend service types are described in Routes.

    Note

    Traffic weights for all backend services must total 100%.

    Backend Services

    Backend service and port that this route forwards requests to.

    Note
    • Click Associated Service to select a source and service.

    • The maximum number of sources depends on the source type.

      • Container Service: up to 5 sources.

      • Nacos and Zookeeper: 1 source only.

    Timeout Period (seconds)

    Request timeout in seconds. Default: 60. Set to 0 to disable the timeout.

    Fallback

    Service that receives requests when the primary backend has no available nodes.

    Note

    Fallback is supported only for HTTP services.

    Retry Times

    Number of retries. Default: 2. Set to 0 to disable retries.

    Retry Condition

    Conditions that trigger a retry.

    Retry Status Code

    Status codes that trigger a retry.