【问题标题】:Appengine modules dispatch.xml routing with custom domain带有自定义域的 Appengine 模块 dispatch.xml 路由
【发布时间】:2014-04-14 08:41:18
【问题描述】:

我有人让 appengine 模块工作。我有两个模块,appauth。我有一个自定义域说 domain.com,我想将 app.domain.com 路由到应用模块,以及 auth.domain.com授权模块,下面是我的 dispatch.xml 文件,

<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>

因为 app 模块是默认的 app.domain.com 已成功路由,但我无法将 auth.domain.com 路由到 auth 模块,它始终指向默认模块,

如何将自定义域路由到服务器特定模块?

谢谢

【问题讨论】:

    标签: java google-app-engine gae-module app-engine-modules


    【解决方案1】:

    使用完整的主机名:

    <dispatch>
      <-- * in front of hostname (*auth) is optional -->
      <-- it allows for subdomain (version) mapping  -->
      <url>*auth.hostname.com/*</url>  
      <module>auth</module>
    </dispatch>
    

    您还应该考虑配置subdomain wildcard mapping:然后GAE 将允许您映射到特定的模块版本,例如

    auth.hostname.com -> auth module, default version
    v1.auth.hostname.com -> auth module, version v1
    

    这对于在开发过程中使用 SSL 非常有用,当您想直接处理特定版本的模块时。

    【讨论】:

    • 我试过了但没有运气,auth.domain.com 仍然指向默认版本
    • 我们在我们的应用程序中使用了这个设置并且它可以工作。确保没有其他问题。
    • 它现在正在使用此路由,问题是域 cname 映射,现在已修复,谢谢!
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-01-09
    • 1970-01-01
    • 1970-01-01
    • 2011-11-23
    • 2016-02-20
    • 1970-01-01
    相关资源
    最近更新 更多