Appengine modules dispatch.xml routing with custom domain

不羁岁月 提交于 2019-12-06 15:04:23

问题


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


回答1:


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.



来源:https://stackoverflow.com/questions/23055616/appengine-modules-dispatch-xml-routing-with-custom-domain

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!