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 one or more forwarding rules and an action.
and select the desired region and project.
in the upper left corner to display Service List and choose Network > Elastic Load Balancing.Parameter |
Description |
Example Value |
|---|---|---|
Name |
Specifies the forwarding policy name. Only letters, digits, underscores (_), hyphens (-), and periods (.) are supported. |
forwarding_policy-e370 |
Domain Name |
Route requests based on the domain name. The domain name in the request must exactly match that in the forwarding policy. Note that you must specify either a domain name or URL. |
www.test.com |
URL Matching Rule |
There are three URL matching rules: |
Exact match |
URL |
Specifies the relative URL for traffic routing. The load balancer routes traffic based on the combination of the domain name and URL. The URL can contain only letters, digits, and special characters _~?;@^- %#&$.*+?,=!:|\/()[]{} If Exact match or Prefix match is selected, the URL must start with a slash (/). |
/login.php |
Description |
Provides supplementary information about the forwarding policy. You can enter up to 255 characters. |
- |
Table 2 describes the parameters required for adding a backend server group, and Table 3 describes the parameters required for configuring health check.
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 Forwarding Policies.You can delete a forwarding policy if you no longer need it.
Deleted forwarding policies cannot be recovered.
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 Forwarding Policies.