Cloud 运行 + Apache + Load Balancer:如何获得正确的路径?

Cloud Run + Apache + Load Balancer: How to get paths right?

早上好,我正在将我的 PHP + Apache 应用程序从 Compute Engine VM 移动到 Google Cloud 运行,我设法启动了 Cloud 运行 服务和 运行 有点工作,但我希望它在 www.mydomainexample.com.br/app/something 可用,当我将负载平衡器设置为“https://www.mydomainexample.com.br/app/something/* -> Cloud 运行 服务”,它在我的 Cloud 运行 服务上命中 Apache 运行,正如预期的那样,但它 returns 404 因为负载均衡器请求“/app/something/" 来自 Apache,它不存在,因为我希望负载平衡器只将用户从那个 URL + 路径发送到我在 Apache 上的 运行 应用程序的起始页,那应该成为我的基地 URL.

所以我需要知道哪个 Google 云平台解决方案或 Apache conf 指令最适合做我想做的事情。 Apache 的“别名”不起作用,我一直不确定它是否真的是正确、聪明和更漂亮的方法。

您可以执行 path rewrite with HTTPS load balancer.

  • 在主机和路径规则中,点击高级
  • 设置默认规则(任何路径,任何域)然后添加新的主机和路径规则
  • 从那里添加路径规则

  • 然后这样配置