You can add forwarding policies to HTTP or HTTPS listeners to forward requests to different backend server groups based on domain names or URLs.
This is suited for applications that are deployed on multiple backend servers and provide multiple types of services such as videos, images, audios, and texts.
A forwarding policy consists of a forwarding rule and an action.
If you add a forwarding policy that is the same as an existing one, there will be a conflict. Even if you delete the existing forwarding policy, the newly-added forwarding policy is still in the Faulty state. Delete the newly-added forwarding policy and add a different one.
and select the desired region and project.
in the upper left corner to display Service List and choose Network > Elastic Load Balancing.Alternatively, locate the load balancer in the load balancer list and click the name of the listener in the Listener column. In the Listeners area, click Add on the right of Forwarding Policies and then add a forwarding policy.
Item |
Parameter |
Description |
Example Value |
|---|---|---|---|
Configure Forwarding Policy |
Name |
Specifies the forwarding policy name. |
forwarding_policy-q582 |
Domain Name |
Specifies the domain name used for forwarding requests. The domain name in the request must exactly match that in the forwarding policy. You need to specify either a domain name or URL. |
www.test.com |
|
URL Matching Rule |
|
Exact match |
|
URL |
Specifies the URL used for forwarding requests. |
/login.php |
|
Description |
Provides supplementary information about the forwarding policy. |
N/A |
|
Add Backend Server Group |
Backend Server Group |
Specifies whether you want a new backend server group or an existing backend server group. If you select Create new, configure the parameters based on Table 1 and Table 2. If you select Use existing, select an existing backend server group. |
Create new |
The following table lists how a URL is matched, and Figure 1 shows how a request is forwarded to a backend server group.
URL Matching Rule |
URL |
URL in the Forwarding Policy |
|||
|---|---|---|---|---|---|
- |
- |
/elb/index.html |
/elb |
/elb[^\s]* |
/index.html |
Exact match |
/elb/index.html |
√ |
- |
- |
- |
Prefix match |
√ |
√ |
- |
- |
|
Regular expression match |
√ |
- |
√ |
- |
|
In this figure, the system first searches for an exact match of the requested URL (/elb_gls/glossary.html). If there is no exact match, the system searches for a prefix match. If a match is found, the request is forwarded to backend server group 2 even if a regular expression match is also found, because the prefix match has a higher priority.
and select the desired region and project.
in the upper left corner to display Service List and choose Network > Elastic Load Balancing.
on the right of its name.
and select the desired region and project.
in the upper left corner to display Service List and choose Network > Elastic Load Balancing.
on the right of its name.