4

这是我想要实现的目标

http://foo.somedomain.comhttp://myapp.appspot.com/foo (google appengine app myapp) 处理,并且底层 url 被屏蔽。

请注意以下事项:

  • somedomain.com 是想要添加 foo.somedomain.com 的第三方域
  • mydomain.com 将 CNAME'd 到 myapp.appspot.com
  • mydomain.com/foo 将指向 myapp.appspot.com/foo

其他场景

  1. foo.mydomain.com 可以指向 myapp.appsot.com/foo
  2. foo.somedomain.com 可以直接指向 myapp.appspot.com/foo

补充:myapp.appspot.com 是使用带有 app-engine-patch 的 django 开发的

4

3 回答 3

6

您不能按照描述的方式执行此操作。为此,您需要:

  1. CNAME foo.somedomain.com 到 ghs.google.com(不是 myapp.appspot.com)
  2. 在 somedomain.com 上为您的域设置 Google Apps(如果尚未设置)
  3. 通过应用程序控制面板将应用程序“myapp”添加到 foo.somedomain.com

Once that's done, your app can check self.request.host to determine which hostname was sent, and route requests appropriately.

于 2009-06-11T07:52:24.167 回答
0

您可以从标头解析子域Host,然后调用webapp.RequestHandler适当的路径/[sub-domain],假设*.yourdomain.com被定向到 Google App Engine 应用程序。

看看webapp.WSGIApplication是否有办法获取webapp.RequestHandler路径的映射。或者,您可以修改请求对象以更改请求的路径(但是,我不确定。)

于 2009-06-10T15:11:13.087 回答
0

This question was asked in one of the 2009 Google I/O app engine talks. Unfortunately the answer given was along the lines of not supported at this time but the possibilities of some workarounds may exist. 2009 Google I/O videos

于 2009-06-17T03:37:26.290 回答