多个自定义域到特定版本的Google App Engine应用
假设我有 myapp.appspot.com
和两个分别称为 foo.com
和 bar.com
的自定义域.如何配置Google App Engine(GAE),以便:
Let's say I have myapp.appspot.com
and two custom domains respectively called foo.com
and bar.com
. How do I configure Google App Engine (GAE) such that:
(www.)foo.com-> foo .myapp.appspot.com
(www.)foo.com -> foo.myapp.appspot.com
(www.)bar.com-> bar .myapp.appspot.com
(www.)bar.com -> bar.myapp.appspot.com
(www.)foo.com->myapp.appspot.com(默认版本)
(www.)foo.com -> myapp.appspot.com (default version)
我正在阅读 https://developers.google.com/appengine/docs/domain,但我仍然不知道如何配置它.我觉得GAE仅支持一个自定义域的通配符,例如 **.foo.com
.
I'm reading https://developers.google.com/appengine/docs/domain but I still don't understand how to configure it. I get the impression that GAE only supports wildcard for one custom domain e.g. **.foo.com
.
您无法真正直接做到这一点,因为您将自定义域与应用ID而不是应用URL关联了.
You can't really do that directly, as you associate your custom domain with an App ID rather than the App URL.
我想您可以将foo.com和bar.com都映射到您的App ID,然后在App Engine的默认版本中解析URL并进行相应的重定向,但这不是一个很好的解决方案,因为您将从您的自定义域返回到appspot.com域.
I guess you could map both foo.com and bar.com to your App ID, then in the default version of your App Engine parse the URL, and redirect accordingly, but it's not a great solution as you would be redirecting from your custom domain back to appspot.com domain.