如何让foo.somedomain.com在appengine上由myapp.appspot.com/foo处理 [英] How do i get foo.somedomain.com get handled by myapp.appspot.com/foo on appengine
问题描述
这是我想要实现的
http ://foo.somedomain.com 由
处理 http://myapp.appspot .com / foo (Google appengine app myapp)
,底层网址被屏蔽。
http://foo.somedomain.com gets handled by http://myapp.appspot.com/foo (google appengine app myapp) and the underlying url is masked.
请注意以下事项:
- somedomain.com是第三方域名,希望添加foo.somedomain.com
- mydomain.com将CNAME'd to myapp.appspot.com
- mydomain.com/foo将指向myapp.appspot.com/foo
其他情况
- 可以将foo.mydomain.com指向myapp.appsot.com/foo
- 可以foo.somedomain.com直接指向myapp.appspot.com/foo
添加:myapp.appspot.com是使用django w / app-engine-patch开发的。
Added: myapp.appspot.com is developed using django w/ app-engine-patch
推荐答案
你不能按照描述的方式执行此操作。为此,您需要:
You can't do this in the way described. In order to do this, you need to:
- CNAME foo.somedomain.com到ghs.google.com(不是myapp.appspot .com)
- 在somedomain.com上为您的域设置Google Apps(如果尚未)
- 将应用myapp添加到foo。 somedomain.com通过应用程序控制面板
一旦完成,您的应用程序可以检查self.request.host以确定发送了哪个主机名,并适当地路由请求。
Once that's done, your app can check self.request.host to determine which hostname was sent, and route requests appropriately.
这篇关于如何让foo.somedomain.com在appengine上由myapp.appspot.com/foo处理的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!