This topic describes how to add domain name extensions.

Background information

A guaranteed-performance SLB instance SLB1 in the China (Hangzhou) region is used as an example. An HTTPS listener is added to the SLB instance. One-way authentication is enabled for the listener. You want to forward requests from the domain name *.example1.com to the VServer group test1 and forward requests from the domain name www.example2.com to the VServer group test2.

Perform the following steps:
  1. Add an HTTPS listener.
  2. Configure forwarding rules.
  3. Add domain name extensions.

Prerequisites

  • A guaranteed-performance SLB instance SLB1 is created in the China (Hangzhou) region. For more information, see Create a CLB instance.
  • An SSL certificate is uploaded. For more information, see Certificate overview.
    • The default certificate used by the listener is default.
    • The certificate example1 is used by the domain *.example1.com.
    • The certificate example2 is used by the domain www.example2.com.

Step 1: Add an HTTPS listener

Perform the following operations:

  1. In the left-side navigation pane, choose Instances > Instances.
  2. On the Instances page, find the SLB1 instance and click Configure Listener in the Actions column.

    If it is the first time you configure a listener for the instance, you can also click Configure in the Port/Health Check/Backend Server column.

  3. Configure a listener.
    The following configurations are used for this example. For more information, see Add an HTTPS listener.
    • Mutual authentication: Disabled.
    • SSL certificate: Select the uploaded server certificate that is named default.
    • Backend servers: Create VServer groups test1 and test2.

Step 2: Configure forwarding rules

Perform the following operations:

  1. Click the ID of the SLB1 instance to go to the Instance Details page.
  2. On the Listener tab, find the HTTPS listener and then Set Forwarding Rule.
  3. On the Add Forwarding Rule page, configure a forwarding rule. For more information, see Forward requests based on domain names or URLs.
    For this example, domain name-based forwarding rules are configured and URLs are left empty.
    • Set a rule name. Enter *.example1.com in the Domain Name column, select the VServer group test1, and then click Add Rule.
    • Set a rule name. Enter www.example2.com in the Domain Name column, select the VServer group test2, and then click OK.
    Note The domain names configured in the forwarding rules must be the same as the domain names added in the certificate and Step 3: Add domain name extensions.

Step 3: Add domain name extensions

Perform the following operations:

  1. Click the ID of the SLB1 instance to go to the Instance Details page.
  2. On the Listener tab, find the HTTPS listener and then choose More icon > Additional Domains.
  3. On the Additional Domains page, click Add Additional Domain to add domain name extensions.
    • Enter domain names. The domain name can contain only letters, digits, hyphens (-), and periods (.).
      Domain name-based forwarding rules include exact matching and wildcard matching.
      • Exact domain name: www.aliyun.com
      • Wildcard domain name: *.aliyun.com and *.market.aliyun.com

        When a request matches multiple forwarding rules, exact matching prevails over exact wildcard matching, and exact wildcard matching prevails over less exact wildcard matching. The following table describes the priority of domain name-based forwarding rules.

        Mode Request URL Domain name-based forwarding rule
        www.aliyun.com *.aliyun.com *.market.aliyun.com
        Exact matching www.aliyun.com × ×
        Exact wildcard matching market.aliyun.com × ×
        Less exact wildcard matching info.market.aliyun.com × ×
    • Select the certificate associated with the domain name.
      Note The domain name in the certificate must be the same as the added domain name extension.
Notice If a problem occurs after the configuration is complete, restart the browser to avoid the impact of the cache on the results.