Last updated：2021-05-26 16:59:41
Layer 7 SLB supports domain name- and URL-based forwarding policies. You can forward requests from different domain names or URLs to different backend server groups to achieve load balancing among your servers.
In a URL-based forwarding policy, you can configure the forwarding mode, session persistence, and health check rules that are independent from the listener configuration. A switch is provided to specify whether the URL-based policy inherits the listener configuration. If the switch is turned on, the policy inherits the configuration of the listener. Otherwise, the forwarding mode, session persistence, and health check rules of the policy prevail.
Domain name-based forwarding: Exact match to a domain name is supported. The domain name to be matched can contain uppercase letters, lowercase letters, digits, periods (.), and hyphens (-). For example, the domain name can be www.ksyun.com. You can also set an empty domain name. In this case, the URL cannot contain only a forward slash (/).
URL-based forwarding: A valid URL to be matched must start with a forward slash (/) and can contain uppercase letters, lowercase letters, digits, and the following special characters: .-/%?#&. URL-based forwarding is performed based on the longest prefix match rule. For example, if URLs /abc and /abcd are used for matching in forwarding policies and a request URL is /abcde, the request is forwarded to /abcd with priority.
You can add multiple forwarding policies to a listener. Each forwarding policy is associated with different backend server groups. For example, you can enable all read requests to be forwarded to a backend server group and all write requests to be forwarded to another. In this way, you can optimize the utilization of server resources in a flexible manner.
Each domain name can be bound to its own certificate. If an empty domain name is specified in a forwarding policy, the listener certificate is used and cannot be changed. Domain names under a listener can use the same certificate as the listener.
|Domain name||Four domain names per listener|
|URL||15 URLs per domain name|
After you configure forwarding policies, Layer 7 SLB forwards a request in the following steps:
Determine whether the request contains a domain name, such as www.ksyun.com.
If the domain name does not match a forwarding policy, forward the request to the backend server bound to the listener. If this domain name matches a forwarding policy, check whether the request URL matches the forwarding policy.
If the request URL matches the forwarding policy, forward the request to the corresponding backend server group. Otherwise, forward the request to the backend server bound to the listener.
Create a domain name- and URL-based forwarding policy
Log in to the SLB console.
In the left navigation pane, click Listener.
On the page that appears, find the Layer 7 listener for which you want to create a forwarding policy and click Add Forwarding Policy in the Operation column.
In the Add Forwarding Policy dialog box, set the following parameters to configure a domain name- and URL-based forwarding policy:
Domain Name: the domain name of requests to be forwarded. The domain name can contain uppercase letters, lowercase letters, digits, periods (.), and hyphens (-). Example: www.ksyun.com.
URL: the URL of requests to be forwarded. The URL must start with a forward slash (/) and can contain uppercase letters, lowercase letters, digits, and the following special characters: .-/%?#&.
Real Server Group: the backend server group associated with the forwarding policy.
Synchronize Listener Configuration: specifies whether to synchronize the forwarding mode, session persistence, and health check rules of the listener.
Alternatively, you can also select the listener and click Forwarding Policy in the displayed area below the listener list to create a forwarding policy.
Edit a domain name- and URL-based forwarding policy
Did you find the above information helpful?
Please give us your feedback.
Thank you for your feedback.