Use a custom domain with API Gateway

A custom domain for your gateway can be implemented by configuring HTTP(S) Load Balancing for API GatewayPREVIEW. Once the HTTP(S) load balancer for your gateway is set up, follow the steps below to update your custom domain's DNS records to point to the new load balancer service.

These steps are also required when using an HTTP(S) load balancer with a Google-managed certificate (which requires a domain). Allocating and using a static IP address is recommended when used with DNS. The specific instructions for this step depend on your DNS provider.

For more information on setting up an HTTP(S) Load Balancer for API Gateway, see Get started with HTTP(S) Load Balancing for API GatewayPREVIEW

  1. To send traffic to the load balancer, the DNS record of your custom domain (for example, my-app-domain) must point to the IP address(es) of the load balancer.

    To find the IP address of your global forwarding rule, use this command:

    gcloud compute forwarding-rules list
  2. Update your domain's DNS A or AAAA record to point to the load balancer's IP address so that traffic sent to the existing custom domain URL is routed through the load balancer instead. It may take as little as several seconds or as long as several hours for DNS to propagate this change to the DNS server.