You can add advanced forwarding policies to HTTP or HTTPS listeners of dedicated load balancers to route requests more specifically.
Alternatively, click Forwarding Policies on the right of the page.
Configure the parameters based on Table 1.
Parameter |
Description |
Example Value |
|
---|---|---|---|
Forwarding Rule |
Domain name |
Route requests based on the domain name. Exact match domains and wildcard domains are supported.
|
www.example.com |
URL |
Route requests based on the URLs.
|
Request URL: /login.php
|
|
HTTP request method |
Route requests based on any HTTP method. The following methods are available: GET, POST, PUT, DELETE, PATCH, HEAD, and OPTIONS. You can configure multiple request methods in a forwarding policy. |
GET |
|
HTTP header |
Route requests based on the HTTP header. An HTTP header consists of a key and one or more values. You need to configure the key and values separately.
|
|
|
Query string |
Route requests based on the query string. A query string consists of a key and one or more values. You need to set the key and values separately.
|
|
|
CIDR block |
Route requests based on the source IP addresses. |
192.168.1.0/24 |
|
Action |
Forward to a backend server group |
Requests are forwarded to the specified backend server group. |
Forward to a backend server group |
Redirect to another listener |
Forwards requests from the HTTP listener to an HTTPS listener. NOTE:
If you select Redirect to another listener and create a redirect for the current listener, this listener will not route requests and will redirect the requests to the specified HTTPS listener, but access control configured for the listener will still take effect. For example, if you configure a redirect for an HTTP listener, HTTP requests to access a web page will be redirected to the HTTPS listener you select and handled by the backend servers associated with the HTTPS listener. As a result, the clients access the web page over HTTPS. |
- |
|
Redirect to another URL |
Requests are redirected to the configured URL. When clients access website A, the load balancer returns 302 or any other 3xx status code and automatically redirects the clients to website B. You can custom the redirection URL that will be returned to the clients. A URL consists of the following parameters:
NOTE:
Specify either the above parameters or a combination of them. |
Protocol: HTTP Domain name: www.example1.com Port: 8081 Path: /index.html Query string: locale=en-us HTTP status code: 301 |
|
Return a specific response body |
Load balancers return a fixed response to the clients. You can custom the status code and response body that load balancers directly return to the clients without the need to route the requests to backend servers. A response body consists of the following parameters:
|
HTTP Status Code: 200 Content-Type: text/plain Message Body: The server can be accessed normally. |
Multiple forwarding policies can be sorted to set their priorities.
Alternatively, click Forwarding Policies in the right pane.
Table 2 shows how URLs configured in the forwarding policies match the URLs in the requests.
Request URL |
Forwarding Policy |
URL in the Forwarding Policy |
Matching Mode |
Forwarding Policy Priority |
Forward to a backend server group |
---|---|---|---|---|---|
/elb/abc.html |
Forwarding policy 01 |
/elb/abc.html |
Prefix match |
1 |
Backend server group 01 |
Forwarding policy 02 |
/elb |
Prefix match |
2 |
Backend server group 02 |
|
/exa/index.html |
Forwarding policy 03 |
/exa[^\s]* |
Regular expression match |
3 |
Backend server group 03 |
Forwarding policy 04 |
/exa/index.html |
Regular expression match |
4 |
Backend server group 04 |
|
/mpl/index.html |
Forwarding policy 05 |
/mpl/index.html |
Exact match |
5 |
Backend server group 05 |
URLs are matched as follows:
Alternatively, click Forwarding Policies in the right pane.
You can delete a forwarding policy if you no longer need it.
Deleted forwarding policies cannot be recovered.
Alternatively, click Forwarding Policies in the right pane.