All Documents
Current Document

Content is empty

If you don't find the content you expect, please try another search term

Documentation

Domain name- and URL-based forwarding policies

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.

Introduction to domain name- and URL-based forwarding

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.

Quota (unadjustable)

Item Quota
Domain name Four domain names per listener
URL 15 URLs per domain name

Forwarding policies

After you configure forwarding policies, Layer 7 SLB forwards a request in the following steps:

  1. Determine whether the request contains a domain name, such as www.ksyun.com.

  2. 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.

  3. 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.

Configure domain name- and URL-based forwarding policies

Create a domain name- and URL-based forwarding policy

  1. Log in to the SLB console.
  2. In the left navigation pane, click Listener.
  3. 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.
  4. 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.

  5. Click OK.

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

  1. Log in to the SLB console.
  2. In the left navigation pane, click Listener.
  3. On the page that appears, select the Layer 7 listener for which you want to edit the forwarding policy. In the displayed area below the listener list, click Forwarding Policy.
  4. In the forwarding policy list, find the forwarding policy that you want to edit, click Edit in the Operation column, and modify the settings of the forwarding policy.
On this page
Pure ModeNormal Mode

Pure Mode

Click to preview the document content in full screen
Feedback