Wildcard Domain Access
Providing an independent external access domain for each user's CloudBase environment is a key step for the platform to deliver accessible applications to users.
Platform Edition supports the package-level wildcard domain solution: after the platform configures a wildcard domain on the package and provides a wildcard certificate, each environment only needs to add a subdomain to serve traffic externally, without uploading certificates repeatedly. Individual environments can also bind independent domains with custom certificates.
Wildcard Domain Configuration
Wildcard domain configuration is a one-time operation completed by the platform at the package level:
- Configure a wildcard domain (for example,
*.example.com), covering all subdomains under it - Provide a wildcard certificate (covering all subdomains), which takes effect automatically when subdomains are added later, with no need to upload certificates for each environment
After configuring the wildcard domain, CloudBase returns the target domain. You need to go to the corresponding domain registrar console to add a CNAME record to resolve the wildcard domain to the target domain. After that, subdomains under the wildcard domain can be accessed externally.
Once configured, the platform can add subdomains for each environment on demand (for example, env1.example.com, env2.example.com). All subdomains share the wildcard certificate to serve HTTPS traffic.
Environment Subdomain Access
When a user requests an environment, your system completes environment creation and domain access with the following flow:
- Create environment: after a user requests an environment, your system calls CloudBase to create it. See Create environment
- Add subdomain and route: after the environment is created, call CloudBase APIs to add a custom domain (a subdomain under the package wildcard domain) and route configuration for the environment; the subdomain automatically reuses the wildcard certificate
- Return to user: return the environment ID and subdomain to the user
Custom Certificate (Optional)
The wildcard certificate covers all subdomains, so in most scenarios no additional configuration is needed. If an individual environment needs an independent domain or its own certificate, you can:
- Bind an independent domain for the environment (not limited to the package wildcard domain)
- Configure the custom certificate corresponding to that domain, replacing the wildcard certificate
Related APIs
- Create HTTP gateway domain / route: CreateHTTPServiceRoute
- Modify HTTP gateway domain / route: ModifyHTTPServiceRoute
- Describe HTTP gateway domain / route: DescribeHTTPServiceRoute
- Delete HTTP gateway domain / route: DeleteHTTPServiceRoute
- Bind static hosting domain: CreateHostingDomain
- Query static hosting domain task status: DescribeHostingDomainTask
Note: For the specific configuration of the wildcard domain and certificate, refer to the CloudBase console and API documentation.
Next Steps
After completing wildcard domain access, you can issue access credentials for each environment: