gpt4 book ai didi

google-cloud-platform - 是否可以将相同的 url 结构映射到多个云运行服务?

转载 作者:行者123 更新时间:2023-12-04 15:10:53 24 4
gpt4 key购买 nike

我有多个服务都位于同一个子域下,只能通过给定 URL 中的路径来区分。但是,URL 中的路径不是服务的名称。如果我要使用云运行,有没有办法创建 URL 映射/掩码以将流量正确路由到我的服务?例如:

subdomain.example.com/path1subdomain.example.com/path2可能映射到服务 foobar分别。我知道我可以使用路由 path1 的 URL 映射至 foopath2bar ,但我也想将流量发送到每项服务的特定修订版。 URL 掩码允许您指定一个标记,因此我可以将特定的登台 URL 作为 <tag>-subdomain.example.com/path1<tag>-subdomain.example.com/path2 ,但我不知道如何在只有 tag 时配置 URL 掩码是可变的。我将如何路由流量:

<tag>-subdomain.example.com/path1 => foo-svc (revision=tag)

subdomain.example.com/path1 => foo-svc

<tag>-subdomain.example.com/path2 => bar-svc (revision=tag)

subdomain.example.com/path2 => bar-svc

我愿意部署单独的云运行服务 foo-<tag>-svcbar-<tag>-svc旁边foo-svcbar-svc如果这能让事情变得更容易。

最佳答案

Is it possible to map the same url structure to multiple cloud runservices?

仅使用 Google Cloud Run 和自定义域,不

结合谷歌云 HTTPS 负载均衡器,是的。

如果您添加负载均衡器,Cloud Run 将成为后端。

使用负载均衡器允许您使用 URL 映射将流量定向到后端。这也增加了许多附加功能。此链接显示了如何设置所有内容。

Setting up a load balancer with Cloud Run

关于google-cloud-platform - 是否可以将相同的 url 结构映射到多个云运行服务?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/65227305/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com