Updated on 2025-03-07 GMT+08:00

Adding a Route

Scenarios

You can add multiple routes and configure multiple forwarding policies for a created gateway.

Procedure

  1. Log in to the ASM console and click the name of the target service mesh to go to its details page.
  2. In the navigation pane, choose Gateway Management. On the displayed page, locate the target gateway and click Add Route in the Operation column. In the displayed dialog box, configure the following parameters:

    • URL Matching Rule
      • Prefix match: A URL can be accessed if its prefix is the same as the URL you set. For example, if the URL is set to /healthz, /healthz/v1 and /healthz/v2 can be accessed.
      • Full match: Only the URL that fully matches the URL you set can be accessed. For example, if the URL is set to /healthz, only /healthz can be accessed.
    • URL

      Mapped URL that can access the target service, for example, /example.

      The URLs of the same gateway must be unique.

    • Namespace

      Select the namespace that the gateway belongs to.

    • Target Service

      Service of the gateway. Select a value from the drop-down list box. The target service is filtered based on the corresponding gateway protocol. For details about the filtering rules, see .

      The service which configuration diagnosis fails cannot be selected. You need to fix the issues first. For details, see Fixing Items Manually or Fixing Items Automatically.

    • Access Port

      Only ports that match external protocols are displayed.

    • Rewrite

      (This parameter is configurable when the external protocol is HTTP.)

      Rewrite the HTTP URI and host/authority header before forwarding. This option is disabled by default. To enable it, configure the following parameters:

      • URI: used to rewrite the URI or prefix. If the original path is matched by prefix, the value provided in this field replaces the corresponding matched prefix.
      • Host/Authority Header: used to rewrite the HTTP host/authority header.
    • Specify Domain Name

      Configure a routing rule for a domain name of the gateway.

  3. Click OK.