Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

App Engine custom domain with service

Tags:

I set up a custom domain with App Engine after following the instructions on DNS records:

https://cloud.google.com/appengine/docs/standard/java/mapping-custom-domains

It's working for the default service using URL http://MY_CUSTOM_DOMAIN but I'm unable to access other services with URLs http://SERVICE_ID.MY_CUSTOM_DOMAIN. Do I need to map a different set of DNS records?

like image 901
sanooj Avatar asked Mar 25 '18 21:03

sanooj


People also ask

How do I use custom domain with App Engine?

In the Google Cloud console, go to the Custom Domains tab of the App Engine Settings page. Click Add a custom domain. If your domain is already verified, the domain appears in the Select the domain you want to use section. Select the domain from the drop-down menu and click Continue.

What DNS record is set when mapping a custom domain to be an alias for the default?

What DNS record type is set when mapping a Custom Domain to be an alias for the default {sitename}. azurewebsites.net domain name assigned to a Web App by Azure? Correct Answer! Show Answer!


1 Answers

Here's a step-by-step:

  1. Ensure you are a owner of the parent domain in here: https://www.google.com/webmasters/verification/home (e.g for subdomain.example.com you need to own example.com) If not, ask a friend to add you as an owner.
  2. Create a CNAME record pointing to: ghs.googlehosted.com (in Cloud DNS or wherever). Note: This will cause downtime, but it is required for App Engine to create an SSL certificate so downtime is unavoidable...
  3. Add custom domain to App Engine
    1. Go to App Engine -> Settings -> Custom Domains
    2. Click on Add a custom domain
    3. Choose the verified parent domain and click Continue
    4. Enter the subdomain (e.g subdomain.example.com) and click Save mappings
    5. Click Done (you already did this last step)
  4. Update App Engine dispatch rules
    1. Run gcloud app describe --project <GOOGLE_CLOUD_PROJECT_ID> and take a look at the current section of dispatchRules
    2. Create dispatch.yaml or dispatch.yml file with your new rule as well as the ones already existing above (note the file format is different from the command output)
    dispatch:   - url: <DOMAIN>/* # e.g. subdomain.example.com/*     service: <SERVICE-NAME> 
    1. Deploy it using: gcloud app deploy dispatch.yaml --project <GOOGLE_CLOUD_PROJECT_ID>
like image 87
Oded Niv Avatar answered Oct 05 '22 14:10

Oded Niv