Search code examples
google-app-enginesubdomain

Google App Engine: versioning with custom sub domains


I'm trying to setup GAE with a custom sub domain and a specific version url.

For example I have an app running with the following setup

VERSION_ID: 1234
SERVICE_ID: my-app
PROJECT_ID: my-project

The provided url https://1234-dot-my-app-dot-my-project.ew.r.appspot.com works fine. But I can't get to work with my custom domain + sub domain. Googles documentation states the following urls are the same:

https://VERSION_ID-dot-default-dot-PROJECT_ID.REGION_ID.r.appspot.com
https://VERSION_ID.CUSTOM_DOMAIN

But when visiting 1234.api.mycustomdomain.com it does not work. However api.mycustomdomain.com works, pointing to the latest running version of my-app

What am I missing? Thanks.


Solution

  • According to the docs, routing by using an specific VERSION_ID it will only work for the default service. As the example shows:

    default service

    https://VERSION_ID-dot-default-dot-PROJECT_ID.REGION_ID.r.appspot.com https://VERSION_ID.CUSTOM_DOMAIN

    And in your case you are targeting the service SERVICE_ID: my-app and thus why the routing is not working. So in your case you need to use the following:

    https://SERVICE_ID.CUSTOM_DOMAIN which in your case equals to:

    https://my-app.CUSTOM_DOMAIN