Forwarding Policy Priorities of LoadBalancer Ingresses
CCE sets up forwarding policies on the ELB console based on the rules specified in the ingress configurations when creating LoadBalancer ingresses.
To address more complex traffic routing requirements, CCE has integrated advanced forwarding policies from ELB. This integration enables features such as URL redirection and rewriting. Note that the sorting logic for these advanced forwarding policies differs from that of standard forwarding policies.
The following table lists their differences.
Scenario |
No Priority Specified |
Priority Specified |
---|---|---|
ELB advanced forwarding disabled |
Forwarding policies are sorted based on domain name or path mappings. For details, see Default Sorting. |
Forwarding policies are sorted based on a specified priority.
For more details, see Configuring the Priorities of Forwarding Rules for LoadBalancer Ingresses. |
ELB advanced forwarding enabled |
Forwarding policies are prioritized by creation time, with earlier-created policies having a higher priority. Requests are matched and forwarded accordingly. For details, see Sort by Creation Time. |

Default Sorting
If the ELB advanced forwarding policies are not enabled, the default sorting rule of forwarding policies is as follows:
- Forwarding rule priorities are independent of each other regardless of domain names. When a request matches both a domain name-based rule and a URL-based rule, the domain name-based rule is matched first.
- URL-based forwarding rules are applied in the following order of priority: an exact match rule, a prefix match rule, and a regular expression match rule. For multiple matches of the same type, only the longest URL-based forwarding rule will be applied.
Forwarding Policy |
Specified Value |
Order |
---|---|---|
URL (exact match) |
/test1/test2/test3 |
1 |
URL (prefix match) |
/test1/test2 |
2 |
URL (prefix match) |
/test1 |
3 |
Once a forwarding policy is created, the system automatically sorts it based on the default sorting rule. Examples are as follows:
- The access request to www.example.com/test1/test2 matches both forwarding policies 2 and 3. If the match types are the same, the priority is determined by the length of the URL, with longer URLs having higher priority. In this case, the access request will be forwarded based on the forwarding policy 2.
- The access request to www.example.com/test1/test2/test3 matches forwarding policies 1, 2, and 3. An exact match is preferred, so the access request will be forwarded based on the forwarding policy 1.
Sort by Creation Time
When ELB advanced forwarding is enabled, each forwarding policy is numbered based on its creation time. A smaller value indicates a higher priority. Requests are matched sequentially to these policies. Once a policy is matched, the request is forwarded accordingly.
The rules for configuring the priority of a forwarding policy are as follows:
- The existing forwarding policies will maintain their original priority sequence before an advanced forwarding policy is configured.
- Once an advanced forwarding policy is set up, any new forwarding policy added will have the lowest priority. The default forwarding policy always has the lowest priority and is not included in the sorting process.
Forwarding Policy |
Specified Value |
Priority |
---|---|---|
URL (prefix match) |
/test1 |
1 |
URL (exact match) |
/test1 |
2 |
In this example, the access request to www.example.com/test1 satisfies both forwarding policies 1 and 2, so the request will be forwarded based on the forwarding policy 1.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.