Connecting a domain
You can connect your own domain to access the API gateway. You can connect multiple domains to a single API gateway. In this case, the domain is identified by the Host
header.
Warning
It must be a third-level domain or lower. For example, you can connect the www.example.com domain but not example.com. This has to do with how CNAME records are processed on DNS hosting. Learn more in RFC 1912, Section 2.4.
To connect a domain to an API gateway:
-
Add a CNAME record to your DNS provider or to your own DNS server:
<domain> IN CNAME <API_gateway_service_domain>
To find out an API gateway's service domain:
- Go to the management console
. - Select the folder where the API gateway is located, and in the service list, select API Gateway.
- Select the API gateway.
- You can see the service domain under General information.
Domain names must end in a dot.
- Go to the management console
-
In the management console
, select the folder containing the API gateway. -
In the list of services, select Certificate Manager and:
-
Add a Let's Encrypt® certificate or a custom certificate.
Note
Be sure to timely update your certificates. Learn more about updating Let's Encrypt® certificates and user certificates.
-
Wait for the certificate status to change to
Issued
.
-
-
Go back to the folder page.
-
In the list of services, select API Gateway and:
- Select the API gateway.
- In the window that opens, go to Domains.
- Click Attach, select a certificate, and enter a domain name (FQDN).
To add a domain to an API gateway, use the addDomain REST API method for the ApiGateway resource or the ApiGatewayService/AddDomain gRPC API call.