This tutorial describes how to add domain name extensions.
This tutorial uses a guaranteed-performance SLB instance (SLB1) in the China (Hangzhou) region 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.
- Add an HTTPS listener.
- Configure forwarding rules.
- Add domain name extensions.
- Create a guaranteed-performance SLB instance (SLB1) in China (Hangzhou). For more information, see Create an SLB instance.
- Upload the certificates required in this tutorial. For more information, see Certificate overview.
- By default, the listener uses the certificate named default.
- Upload a certificate (example1) for domain name * .example1.com to use.
- Upload a certificate (example2) for domain name www.example2.com to use.
Step 1: Add an HTTPS listener
To add an HTTPS listener, follow these steps:
- Log on to the SLB console.
- In the left-side navigation pane, click .
- On the Server Load Balancer page, find the target instance SLB1 and click Configure Listener in the Actions column.
If it is the first time you configure the listener, you can also click Configure in the Port/Health Check/Backend Server column.
- Configure the listener.
The configurations used in this tutorial are as follows. For more information, see Add an HTTPS listener.
- Mutual authentication: Disable.
- SSL certificate: Select the uploaded server certificate that is named default.
- Backend servers: Create VServer groups test1 and test2.
Step 2: Configure forwarding rules
To configure forwarding rules, follow these steps:
- Click the ID of the instance SLB1.
- On the Listeners tab, find the created HTTPS listener and click Set Forwarding Rule.
- On the Add Forwarding Rules page, configure forwarding rules. For more information, see Forward requests based on domain names or URLs.
In this tutorial, domain name-based forwarding rules are configured and URLs are left empty.
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.
- Set a rule name. Enter * .example1.com in the Domain Name column, select the VServer group test1, and then click Add Forwarding Rules.
- Set a rule name. Enter www.example2.com in the Domain Name column, select the VServer group test2, and then click Add Forwarding Rules.
Step 3: Add domain name extensions
To add a domain name extension, follow these steps:
- Click the ID of the instance SLB1.
- On the Listeners tab, find the created HTTPS listener, choose .
- On the Manage Additional Certificate page, click Add Additional Certificate to add a domain name extension.
- Enter a domain name. The domain name can only contain letters, digits, hyphens (-),
or periods (.).
Domain name-based forwarding rules support exact match and wildcard match.
- Exact domain name: www.aliyun.com
- Wildcard domain name (generic domain name): *.aliyun.com, *.market.aliyun.com
When a request matches multiple forwarding rules, exact match takes precedence over small-scale wildcard match and small-scale wildcard match takes precedence over large-scale wildcard match. The following table shows an example.Note In the following table, ✓ means support, and × means nonsupport.
Type Request URL Domain name based forwarding rule www.aliyun.com *.aliyun.com *.market.aliyun.com Exact match www.aliyun.com ✓ × × Wildcard match market.aliyun.com × ✓ × Wildcard match 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.
- Enter a domain name. The domain name can only contain letters, digits, hyphens (-), or periods (.).
- Click OK.