Compute
Elastic Cloud Server
Huawei Cloud Flexus
Bare Metal Server
Auto Scaling
Image Management Service
Dedicated Host
FunctionGraph
Cloud Phone Host
Huawei Cloud EulerOS
Networking
Virtual Private Cloud
Elastic IP
Elastic Load Balance
NAT Gateway
Direct Connect
Virtual Private Network
VPC Endpoint
Cloud Connect
Enterprise Router
Enterprise Switch
Global Accelerator
Management & Governance
Cloud Eye
Identity and Access Management
Cloud Trace Service
Resource Formation Service
Tag Management Service
Log Tank Service
Config
OneAccess
Resource Access Manager
Simple Message Notification
Application Performance Management
Application Operations Management
Organizations
Optimization Advisor
IAM Identity Center
Cloud Operations Center
Resource Governance Center
Migration
Server Migration Service
Object Storage Migration Service
Cloud Data Migration
Migration Center
Cloud Ecosystem
KooGallery
Partner Center
User Support
My Account
Billing Center
Cost Center
Resource Center
Enterprise Management
Service Tickets
HUAWEI CLOUD (International) FAQs
ICP Filing
Support Plans
My Credentials
Customer Operation Capabilities
Partner Support Plans
Professional Services
Analytics
MapReduce Service
Data Lake Insight
CloudTable Service
Cloud Search Service
Data Lake Visualization
Data Ingestion Service
GaussDB(DWS)
DataArts Studio
Data Lake Factory
DataArts Lake Formation
IoT
IoT Device Access
Others
Product Pricing Details
System Permissions
Console Quick Start
Common FAQs
Instructions for Associating with a HUAWEI CLOUD Partner
Message Center
Security & Compliance
Security Technologies and Applications
Web Application Firewall
Host Security Service
Cloud Firewall
SecMaster
Anti-DDoS Service
Data Encryption Workshop
Database Security Service
Cloud Bastion Host
Data Security Center
Cloud Certificate Manager
Edge Security
Managed Threat Detection
Blockchain
Blockchain Service
Web3 Node Engine Service
Media Services
Media Processing Center
Video On Demand
Live
SparkRTC
MetaStudio
Storage
Object Storage Service
Elastic Volume Service
Cloud Backup and Recovery
Storage Disaster Recovery Service
Scalable File Service Turbo
Scalable File Service
Volume Backup Service
Cloud Server Backup Service
Data Express Service
Dedicated Distributed Storage Service
Containers
Cloud Container Engine
SoftWare Repository for Container
Application Service Mesh
Ubiquitous Cloud Native Service
Cloud Container Instance
Databases
Relational Database Service
Document Database Service
Data Admin Service
Data Replication Service
GeminiDB
GaussDB
Distributed Database Middleware
Database and Application Migration UGO
TaurusDB
Middleware
Distributed Cache Service
API Gateway
Distributed Message Service for Kafka
Distributed Message Service for RabbitMQ
Distributed Message Service for RocketMQ
Cloud Service Engine
Multi-Site High Availability Service
EventGrid
Dedicated Cloud
Dedicated Computing Cluster
Business Applications
Workspace
ROMA Connect
Message & SMS
Domain Name Service
Edge Data Center Management
Meeting
AI
Face Recognition Service
Graph Engine Service
Content Moderation
Image Recognition
Optical Character Recognition
ModelArts
ImageSearch
Conversational Bot Service
Speech Interaction Service
Huawei HiLens
Video Intelligent Analysis Service
Developer Tools
SDK Developer Guide
API Request Signing Guide
Terraform
Koo Command Line Interface
Content Delivery & Edge Computing
Content Delivery Network
Intelligent EdgeFabric
CloudPond
Intelligent EdgeCloud
Solutions
SAP Cloud
High Performance Computing
Developer Services
ServiceStage
CodeArts
CodeArts PerfTest
CodeArts Req
CodeArts Pipeline
CodeArts Build
CodeArts Deploy
CodeArts Artifact
CodeArts TestPlan
CodeArts Check
CodeArts Repo
Cloud Application Engine
MacroVerse aPaaS
KooMessage
KooPhone
KooDrive
Help Center/ API Gateway/ User Guide/ Opening APIs/ Configuring the Domain Name for Calling APIs

Configuring the Domain Name for Calling APIs

Updated on 2025-01-24 GMT+08:00

The system automatically allocates a subdomain name to each API group for internal testing. The subdomain name can be accessed 1000 times a day. Before you expose an API, bind an independent domain name to the API group so that APIs in the group can be accessed with the domain name. A maximum of five independent domain names can be added, and the number of access times is not limited.

Independent domain names are classified into private and public domain names.

  • Private domain name: Service systems deployed on the cloud service platform can use private domain names to access APIs.
  • Public domain name: Service systems deployed outside the cloud service platform can use public domain names to access APIs.

For internal testing, use the debugging domain name (subdomain name) to access APIs in an API group (maximum 1,000 times a day). The debugging domain name cannot be modified.

If the independent domain name you select is a wildcard domain name (for example, *.aaa.com), you can use any of its subdomain names (for example, default.aaa.com and 1.aaa.com) to access all APIs in the group to which the domain name is bound.

Constraints

  • By default, the debugging domain name of an API group can only be resolved to a server in the same VPC as the gateway. If you want to resolve the domain name to a public network, bind an EIP to the gateway.
  • The debugging domain name cannot be used for production services and can be used only for application debugging.
  • Groups under the same gateway cannot be bound with a same independent domain name.
  • If a domain name is already bound to a port, it cannot be bound to the same port again.
  • If different ports are used for the same domain name, all ports take effect no matter whether any of them are bound to, modified, or unbound from the SSL certificate or whether client authentication is enabled or disabled.
  • If you access backend services through a load balance channel, the port bound to the independent domain name must be the same as the access port of the backend server in the load balance channel.
  • After an independent domain name is bound to a port, if you use an IP address to access an API in a custom group, you need to add the header parameter host to the request. The host value should include the port number for access, unless you are using the default ports 80 or 443, in which case the host value is not necessary.
  • Accessing APIs by IP address is not advised, it requires IP certificates for SSL. Otherwise, the connection may be insecure.
  • HTTP-to-HTTPS redirection is only suitable for GET and HEAD requests. Redirecting other requests may cause data loss due to browser restrictions. Redirection takes effect only when the API request protocol is HTTPS or HTTP&HTTPS and an SSL certificate has been bound to the independent domain name.

Obtaining Domain Names

  1. Apply for a domain name.
    • To enable a service system on the cloud service platform to access APIs, obtain a private domain name as an independent domain name. For details, see Creating a Private Zone.
    • To enable a service system outside the cloud service platform to access APIs, obtain a public domain name as an independent domain name. Apply it from Domain Registration.
  1. Add an A record set of the VPC access address. For details, see Adding an A Record Set.

    Configure a CNAME record set of the API group debugging domain name. For details, see Adding a CNAME Record Set.

  2. If the API group contains HTTPS-compatible APIs, add an SSL certificate for the independent domain name bound to the group. Obtain the content and keys of the SSL certificate and create an SSL certificate in advance.

Binding an Independent Domain Name

  1. Go to the APIG console.
  2. Select a dedicated gateway at the top of the navigation pane.
  3. Choose API Management > API Groups.
  4. Click a group name to go to the Group Information page.
  5. In the Independent Domain Names area, click Bind Independent Domain Name.
  6. Set the parameters according to the following table.

    Table 1 Independent domain name configuration

    Parameter

    Description

    Domain Name

    Domain name to be bound to the API group.

    Minimum TLS Version

    TLS is a security protocol used to ensure security and data integrity for Internet communication. Options: TLS1.1, TLS1.2 (recommended). TLS1.0 and TLS1.3 are not supported.

    This parameter applies only to HTTPS and does not take effect for HTTP and other access modes. Configure HTTPS cipher suites using the ssl_ciphers parameter on the Parameters tab.

    HTTP-to-HTTPS Auto Redirection

    HTTP APIs are insecure in transmission and authentication. You can upgrade them for access over HTTPS while ensuring HTTP compatibility.

    Redirection takes effect only when the API request protocol is HTTPS or HTTP&HTTPS and an SSL certificate has been bound to the independent domain name. Redirection is only suitable for GET and HEAD requests. Redirecting other requests may cause data loss due to browser restrictions.

    HTTP Port

    The default value is 80, which is the default HTTP port number. You can customize the inbound port. For details, see Customizing Gateway Inbound Ports. If the HTTP port is not used, select suspend.

    HTTPS Port

    The default value is 443, which is the default HTTPS port. You can customize the inbound port. For details, see Customizing Gateway Inbound Ports. If the HTTPS port is not used, select suspend.

  7. Click OK.

    If the domain name is no longer needed, click Unbind Domain Name to unbind it from the API group.

(Optional) Binding an SSL Certificate

If the API group contains HTTPS APIs, bind an SSL certificate to the independent domain name.

  1. In the row that contains the domain name, click Select SSL Certificate.
  2. Select an SSL certificate and click OK.

    • If a CA certificate has been uploaded for the SSL certificate, you can enable client authentication (HTTPS two-way authentication). Enabling or disabling client authentication will affect the existing services. Exercise caution when performing this operation.
    • If no SSL certificate is available, click Create SSL Certificate to create one. For details, see Adding an SSL Certificate for an API.

Troubleshooting

  • Failure in binding a domain name: The domain name is not resolved or the domain name already exists.
  • Failure in binding an SSL certificate: The domain name used to generate the SSL certificate is different from the target independent domain name.

We use cookies to improve our site and your experience. By continuing to browse our site you accept our cookie policy. Find out more

Feedback

Feedback

Feedback

0/500

Selected Content

Submit selected content with the feedback