Appengine模块使用自定义域的dispatch.xml路由 [英] Appengine modules dispatch.xml routing with custom domain
问题描述
我有人让appengine模块工作。我有两个模块,应用和 auth 。我有一个自定义域名 domain.com ,我想将 app.domain.com 路由到应用模块, auth.domain.com auth模块,以下是我的dispatch.xml文件,
< dispatch>
<! - 默认模块提供简单的主机名请求。 - >
< url> * / favicon.ico< / url>
< module>默认< / module>
< / dispatch>
< dispatch>
<! - Auth Service to auth模块 - >
< url> auth ./*& lt; / url>
< module> auth< / module>
< / dispatch>
< dispatch>
<! - 默认模块提供简单的主机名请求。 - >
< url> * / favicon.ico< / url>
< module>默认< / module>
< / dispatch>
因为app模块是默认app.domain.com已成功路由,但我无法将auth.domain.com路由到auth模块,它始终指向默认模块,
如何将自定义域路由到服务器特定模块?
谢谢
使用完整的主机名称:
<调度>主机名(* auth)前面的
< - *是可选的 - >
< - 它允许子域(版本)映射 - >
< url> * auth.hostname.com / *< / url>
< module> auth< / module>
< / dispatch>
您还应该考虑配置子域通配符映射:然后GAE将允许您映射到特定的模块版本,例如
auth.hostname.com - > auth模块,默认版本
v1.auth.hostname.com - > auth模块,版本v1
这对于在开发过程中使用SSL非常有用,版本的模块。
I have someone got appengine modules working. i have two modules, app and auth. i have a custom domain say domain.com, i want to route app.domain.com to app module, and auth.domain.com to auth modules, following is my dispatch.xml file,
<dispatch>
<!-- Default module serves simple hostname request. -->
<url>*/favicon.ico</url>
<module>default</module>
</dispatch>
<dispatch>
<!-- Auth Service to auth module -->
<url>auth./*</url>
<module>auth</module>
</dispatch>
<dispatch>
<!-- Default module serves simple hostname request. -->
<url>*/favicon.ico</url>
<module>default</module>
</dispatch>
since app module is default app.domain.com is successfully routed, but i couldn't able to route auth.domain.com to auth module, its always pointing to default module,
how can i route custom domain to server specific module?
Thanks
Use full hostname:
<dispatch>
<-- * in front of hostname (*auth) is optional -->
<-- it allows for subdomain (version) mapping -->
<url>*auth.hostname.com/*</url>
<module>auth</module>
</dispatch>
You should also consider configuring the subdomain wildcard mapping: then GAE will allow you to map to particular module versions, e.g.
auth.hostname.com -> auth module, default version
v1.auth.hostname.com -> auth module, version v1
This is useful for using SSL during development, when you want to directly address particular version of a module.
这篇关于Appengine模块使用自定义域的dispatch.xml路由的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!