tencent cloud


Configuring a Custom Domain Name

Last updated: 2021-06-07 15:02:09

    Operation Scenarios

    The domain name binding feature allows you to bind your own domain name to a service, so that the service can be accessed at it.


    • Ensure that the domain name to be bound has been configured for resolution.


    Associating a custom domain name

    1. Log in to the API Gateway console and click Service in the left sidebar to access the service list page.
    2. In the service list, click a service ID to enter the service details page.
    3. On the service details page, select Custom domain, click Create in the top-left corner, enter the configuration information, and click Submit.

      • If you need the HTTPS protocol that supports independent domain names, you should submit the SSL certificate for your domain name by uploading it or by entering the certificate name, content, and private key.
      • A modified CNAME record will take effect after a period of time. Be sure to proceed with the configuration after it takes effect; otherwise, the configuration will fail.
    4. After configuring CNAME resolution, configure the domain name in the service (be sure to configure CNAME resolution first).
    5. To unbind a domain name, delete it from the service and then delete its CNAME record.

    Configuring forced HTTPS

    On the custom domain name configuration page, if the protocol is HTTP&HTTPS or HTTPS, the forced HTTPS feature can be enabled. After it is enabled, API Gateway will redirect requests using the custom domain name over the HTTP protocol to the HTTPS protocol.

    Configuring domain name path mapping

    1. On the custom domain name list page, click Edit Path Mapping in the "Operation" column.
    2. Select the path mapping type:
      • Default path mapping: the URL of the path is custom domain name/environment name. For example, www.XXXXX.com/release points to the release environment in the service, www.XXXXX.com/prepub points to the pre-release environment in the service, and www.XXXXX.com/test points to the test environment in the service.
      • Custom path mapping: the URL is custom domain name/custom path. This URL points to the environment that you map. For example, if the configured path is /mypath and the environment is the release environment, the URL of the release environment will be www.XXXXX.com/mypath. If you want to use the root path, directly configure the path as /.

        When a custom path mapping is used, the default path mapping (custom domain name/environment name) will not take effect.
        Both the custom path mapping and default path mapping can be modified after configuration.

    3. Click Submit to complete the configuration.
    Contact Us

    Contact our sales team or business advisors to help your business.

    Technical Support

    Open a ticket if you're looking for further assistance. Our Ticket is 7x24 avaliable.

    7x24 Phone Support