This tutorial introduces detailed steps for configuring a domain name extension.
This tutorial takes SLB1, the guaranteed-performance SLB instance in China (Hangzhou) region as an example. In this tutorial, an HTTPS listener is created and one-way authentication is used. You need to forward requests with 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 a domain name extension.
- Create a guaranteed-performance SLB instance, SLB1, in China (Hangzhou). For more information, see Create an SLB instance.
- Upload the certificate required in this tutorial. For more information, see Upload certificates.
- The default certificate used by the listener is default.
- The certificate used by the domain name .example1.com is example1.
- The certificate used by the domain name www.example2.com is example2.
Step 1 Create an HTTPS listener
- Log on to the SLB console.
- On the Instances page, click Create SLB Instance. Configure the SLB instance. For more information, see Create an SLB instance.Note Only guaranteed-performance instances support configuring SNI.
- Go back to the Instances page, and then click the ID of the created SLB instance.
- In the left-side navigation pane, click Listeners and then click Add Listener.
- Configure the listener. The configurations used in this tutorial are as follows. For more information, see Layer-7 listener configurations.
- Mutual Authentication: Disable
- Server Certificate: Upload a server certificate named as default.
- Select Create VServer Group, and create VServer groups test1 and test2. , click
Step 2 Add forwarding rules
- On the Listeners page, find the created HTTPS listener and click Add Forwarding Rules.
- On the Add Forwarding Rules page, click Add Forwarding Rules.
- Configure forwarding rules. For more information, see Add domain-name based or URL-based forwarding rules. In this tutorial, domain name-based forwarding rules are configured and URLs are left empty.
- Set the rule name, enter .example1.com in the Domain Name action column, select the test1 VServer group and click Add Forwarding Rule.
- Set the rule name, enter www.example2.com in the Domain Name action column, and select the test2 VServer group and click OK.
Step 3 Add a domain name extension
- On the Listeners page, find the created HTTPS listener, and then click .
- Click Add Domain Extension and configure a domain name:
- Domain Name: Enter a domain name.
Both exact match and wildcard match are supported:
Exact domain name: www.aliyun.com
Wildcard domain name (generic domain name): .aliyun.com, .market.aliyun.com
When a request matches multiple domain name forwarding rules, exact match takes precedence over small-scale wildcard match and small-scale wildcard match takes precedence over large-scale wildcard match, as shown in the following table (√ indicates that the domain name is matched, — indicates that the domain name is not matched).
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 - — ✔
- Certificate: Select the certificate used by this domain name.
If the certificate is not uploaded yet, click Import Certificate.Note The domain name in the certificate must be the same as the added domain name extension.
- Domain Name: Enter a domain name.
- Repeat step 2 to add more domain name extensions.