Updated on 2024-04-03 GMT+08:00

Binding a Domain Name

Scenario

Before you open an API, you must bind one or more independent domain names to the group to which the API belongs.

  • In the shared gateway, you cannot bind the same independent domain name to different API groups.

Note the following points before you bind a domain name:

  • Subdomain name: After an API group is created, the system automatically allocates a unique subdomain name to it for internal testing. The subdomain name can be accessed 1000 times a day, but it cannot be modified.
  • Independent domain name: You can add five custom domain names for API callers to call your open APIs. There is no limit on the number of times these domain names can be accessed.

Prerequisites

  1. There is an independent domain name available.
  2. Shared gateway: A CNAME record points the independent domain name to the subdomain name of the API group. For details, see Adding a CNAME Record Set.
  3. If the API group contains APIs that are called through HTTPS, there needs to be SSL certificates configured for the independent domain name. SSL certificates can only be added manually with a custom name, content, and a key.

Procedure

  1. Access the shared gateway console.
  2. In the navigation pane, choose API Publishing > API Groups.
  3. Go to the Domain Names tab page using one of the following methods:

    • Click the name of the target API group, and click the Domain Names tab on the displayed API group details page.
    • In the Operation column of the target API group, choose More > Manage Domain Name.

  4. Click Bind Independent Domain Name and enter a domain name.
  5. Click OK.

    If the domain name is not needed, click Unbind to unbind it from the API group.

  6. (Optional) If the API group contains APIs that are accessed through HTTPS, add an SSL certificate.

    1. Click Add SSL Certificate.
    2. Enter the name, content, and key of the obtained SSL certificate, and click OK.
    Figure 1 Adding an SSL certificate
    • Currently, you can only add SSL certificates in the PEM format. To add SSL certificates of other formats, convert the certificates into the PEM format first.
    • To replace or edit an SSL certificate, click next to the certificate name. The certificate content and key will not be visible after you click OK to add the certificate. If the content has been updated, add the entire content or key again.
    • If you do not require an SSL certificate, click Delete SSL Certificate in the row containing the certificate to delete it.

Troubleshooting

  • Failure in binding an independent domain name: The independent domain name is not CNAMEd to the subdomain name of the API group, or the independent domain name already exists.
  • Failure in adding an SSL certificate: The domain name of the SSL certificate is different from the domain name for which you add the SSL certificate.

Follow-Up Operations

After binding independent domain names to the API group, create APIs in the group to selectively expose backend capabilities. For details, see Creating an API.