Forwarding Policy
Overview
You can add forwarding policies to HTTP or HTTPS listeners to forward requests to different backend server groups based on domain names or URLs.
A forwarding policy consists of two parts: forwarding rule and action. For details, see Table 1.
Policy Type |
Forwarding Rules |
Actions |
---|---|---|
Forwarding policy |
Domain name and Path |
Forward to another backend server group and Redirect to another listener (only for HTTP listeners) |
Advanced forwarding policy |
Domain name, Path, HTTP request method, HTTP header, Query string, and CIDR block |
Forward to another backend server group, Redirect to another listener, and Return a specific response body |
You can configure an advanced forwarding policy by referring to Managing an Advanced Forwarding Policy.
How Requests Are Matched
- After you add a forwarding policy, the load balancer forwards requests based on the specified domain name or URL:
- If the domain name or URL in a request matches what is specified in the forwarding policy, the request is forwarded to the backend server group you select or create when you add the forwarding policy.
- If the domain name or URL in a request does not match what is specified in the forwarding policy, the request is forwarded to the default backend server group of the listener.
- Matching priority:
- Forwarding policy priorities are independent of each other regardless of domain names. If a forwarding rule uses both domain names and URLs, requests are matched based on domain names first.
- If the forwarding rule is a URL, the priorities follow the order of exact match, prefix match, and regular expression match. If the matching types are the same, the longer the URL length, the higher the priority.
Request |
Forwarding Policy |
Forwarding Rule |
Specified Value |
---|---|---|---|
www.elb.com/test |
1 |
URL |
/test |
2 |
Domain name |
www.elb.com |
In this example, request www.elb.com/test matches both forwarding policies 1 and 2, but is routed based on forwarding policy 2.
Notes and Constraints
- Forwarding policies can be added only to HTTP and HTTPS listeners.
- Forwarding policies must be unique.
- A maximum of 100 forwarding policies can be configured for a listener. If the number of forwarding policies exceeds the quota, the excess forwarding policies will not be applied.
- When you add a forwarding policy, note the following:
- You can specify a URL that does not contain query strings. If the URL is set to /path/resource?name=value, the forwarding policy will not be applied.
- Each path must exist on the backend server. If the path does not exist, the backend server will return 404 Not Found.
- In the regular expression match, the characters are matched sequentially, and matching ends when any rule is matched. Matching rules cannot overlap with each other.
- A URL path cannot be configured for two forwarding policies.
- A domain name cannot exceed 100 characters.
Adding a Forwarding Policy
- Go to the load balancer list page.
- On the displayed page, locate the load balancer you want to add forwarding policy to and click its name.
- On the Listeners tab, add a forwarding policy in either of the following ways:
- Locate the target listener and click Add/Edit Forwarding Policy in the Forwarding Policies column.
- Locate the target listener, click its name, and click Forwarding Policies tab.
- Click Add Forwarding Policy. Configure the parameters based on Table 3.
- Click Save.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot