GCP Point Custom Domain to Specific App Engine Service

Viewed 2491
2 Answers

You cannot map a certain (sub)domain to a certain service in the app-level custom domain mapping, mapping is done only at the app level (as a whole).

To direct a certain (sub)domain to a certain service inside your app you'll need to use a dispatch file, for example:

dispatch:
  - url: "example.com/*"
    module: <frontend-service-name>

Side note: you may want to revisit the decision of handling the frontend in a non-default service: the frontend is IMHO best suited to handle any garbage request coming in (which would typically not match any routing rule and would thus be directed towards the default service). If your default service does something more sensitive than the frontend it might not like that spam coming in.

Related