Different subdomains on same project for different services

118 views
Skip to first unread message

Jay Pozo

unread,
Dec 3, 2016, 3:26:09 PM12/3/16
to Google App Engine
Hi there, is it possible to have different subdomains on the same project point to different services? 

for example:

api.mysubdomain.com points to the default service on the my-project project.
api-dev.mysubdomain.com points to a dev service on the my-project project.

Specifically what I am trying to do is setup staging and production environments on a single project, using Jenkins as a deployment service. What have others done? Would it be better to split into two different projects?

Thanks
Jay

Yunkai Zhou

unread,
Dec 3, 2016, 5:37:20 PM12/3/16
to google-a...@googlegroups.com
(Typing this email on a phone, so be aware of minor details being off. Make sure you read the GAE custom domain documentation for full accuracy.)

GAE custom domain supports wildcard - like *.mydomain.com.

If configured so, when accessing foo.mydomain.com, it will first try to see if you have a service called foo. If yes, it goes to that service. If not, then it goes to the default service.

In other words, what you want is feasible. All you need to do is configure wildcard in DNS and then call the dev service api-dev. Then api-dev.mydomain.com will go to api-dev and rest goes to default.

However, I'd actually recommend against using the same project for both dev and prod. Using 2 projects will probably cause less headache in the long run since they will give you more isolation.

So overall my recommendation (which is also our company's setup):
- one project for one environment
- multiple services in the same project via DNS wildcard

Hope this is helpful.

--
You received this message because you are subscribed to the Google Groups "Google App Engine" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-appengi...@googlegroups.com.
To post to this group, send email to google-a...@googlegroups.com.
Visit this group at https://groups.google.com/group/google-appengine.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-appengine/2eae9602-6a17-4aef-a00d-074a03f49160%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Adam (Cloud Platform Support)

unread,
Dec 4, 2016, 1:35:57 PM12/4/16
to Google App Engine
Expanding on the last post, you can use subdomain routing to match a specific service name, or you can set up a dispatch file to route subdomains or other URL patterns to specific services. Full details are in the documentation, under 'How Requests are Routed'.
Reply all
Reply to author
Forward
0 new messages