After you bind an SLB instance to an application, you can configure different URL-based forwarding policies for different application instance groups in an ECS cluster. The SLB instance can forward requests from different paths to the instance groups of an application based on the specified forwarding policies. This topic describes how to configure URL-based forwarding policies to distribute traffic to the instance groups of an application.
Prerequisites
- An SLB instance is created. For more information, see Create a CLB instance.
- Different instance groups are created for the application. For more information, see Create a group.
- The SLB instance is bound to the application. For more information, see Configure a dedicated SLB instance for an application.
Background information
In an ECS cluster, you can create multiple application instance groups for an application, and deploy different versions of the application on the application instance groups. After the SLB instance is bound to the application, the following scenarios may occur:
- If no forwarding policies are configured for different application instance groups, the traffic is randomly distributed to the application instances in each group.
- If forwarding policies are configured for different application instance groups, the traffic is distributed to the application instances in each group based on the specified policies.
For example, the URL o.domain.com/orders/queryitem is used to query product information in the ordering system. In the scenario of flash sales, this URL is frequently requested compared with the URLs of other services. Therefore, you can deploy the service of querying product information to the flash sales-specific group, and deploy other services to the default group. Then, you can configure URL-based forwarding policies in the SLB instance so that the requests to query product information are forwarded to the flash sales-specific group, and other requests are forwarded to the default group.

Configure vServer groups and forwarding policies for application groups
Configure vServer groups and forwarding policies in the bound SLB instance for the preceding two groups.
Verify results
Check whether you can access the application by using the URLs of the two application instance groups.