即使在定义dispatch.yaml之后,App引擎灵活的http请求仍然会将用户带到默认服务

时间:2018-05-31 18:32:27

标签: google-app-engine app-engine-flexible

我正在使用App Engine Flexible环境,我在App Engine中部署了多项服务。所以我将多个子域连接到我的应用引擎。为了为每个服务分配一个子域,我定义了dispatch.yaml文件。这是它的样子

dispatch:

- url: "wscfg.xxxxxxxxx.com/"
  service: default

- url: "onboarding.xxxxxxxxx.com/"
  service: default

- url: "dtnote.xxxxxxxxx.com/"
  service: default

- url: "careco.xxxxxxxxx.com/"
  service: careco

- url: "userman.xxxxxxxxx.com/"
  service: user-management

将其部署到应用引擎后,它会显示dispatch.yaml文件中指定的自定义域的服务。所以我的调度文件工作正常。 enter image description here

问题是,当我尝试访问https://careco.xxxxxxxxx.com/时,它会将我带到default服务,而https://user-management.xxxxxxxxx.com/则会将我带到userman服务(这是正确的)

1 个答案:

答案 0 :(得分:1)

问题在于dispatch.yaml文件。它最后需要有通配符。所以dispatch.yaml应该看起来像

dispatch:

- url: "wscfg.xxxxxxxxx.com/*"
  service: default

- url: "onboarding.xxxxxxxxx.com/*"
  service: default

- url: "dtnote.xxxxxxxxx.com/*"
  service: default

- url: "careco.xxxxxxxxx.com/*"
  service: careco

- url: "userman.xxxxxxxxx.com/*"
  service: user-management