指定URL而不是IP:网络端点中的端口,用于反向代理后面的应用程序

发布于 2025-01-19 07:40:32 字数 1395 浏览 6 评论 0 原文

我们正在使用GCP外部HTTPS负载平衡器,架构如下图所示。 LB的主要用途是将用户重定向到静态错误站点(托管在云存储桶上),以防CE实例下降,CE上的Traefik崩溃,CE上的Docker Crashes等。

我们在LOAD BALANCER上定义了4个后端服务:

  1. static-error-page 后端桶
  2. blog-backend-service gallery-backend-service shop-backend-service 然后,区域网络端点组

,我们定义了主机和路径规则,以便:

  1. https://blog.company.com - > Blog-Backend-Service
  2. https://gallery.company.com - > Gallery-Backend-Service
  3. https://shop.company.com - > shop-backend-service
  4. 所有无与伦比的(默认) - > static-error-page

每个Zonal网络端点组( Blog-Backend-Service Gallery-Backend-Service shop backend -Service )仅定义了1个端点: 192.168.171:443 192.168.171.3 是CE实例的内部IP)。

但是,由于我的网站是在反向代理(TRAEFIK)后面提供的,因此在网络端点中指定 ip:port 组合是没有用的,因为它们都具有相同的 ip:port 。我想在网络端点中指定URL,而不是 ip:port (这样,网络端点也将显示正确的健康状态,如果网站下降,它总是报告 healthy 现在,即使申请减少)。

是否可以在网络端点中指定URL而不是 ip:port ?如果没有,我的选择是什么?

We are using GCP external HTTPS load balancer, architecture is shown in the diagram below. The primary use of LB is redirecting users to static error site (hosted on Cloud Storage bucket) in case CE instance is down, Traefik crashes on CE, Docker crashes on CE, etc.

We have 4 backend services defined on load balancer:

  1. static-error-page backend bucket
  2. blog-backend-service, gallery-backend-service and shop-backend-service zonal network endpoint groups

Then, we defined host and path rules so that:

  1. https://blog.company.com -> blog-backend-service
  2. https://gallery.company.com -> gallery-backend-service
  3. https://shop.company.com -> shop-backend-service
  4. All unmatched (default) -> static-error-page

Each zonal network endpoint group (blog-backend-service, gallery-backend-service and shop-backend-service) has just 1 endpoint defined: 192.168.171:443 (192.168.171.3 is internal IP of CE instance).

However, since my websites are served behind reverse proxy (Traefik), specifying IP:port combination in network endpoint is useless because they all have the same IP:port. I would like to specify URL instead of IP:port in network endpoint (that way network endpoint would also show correct health status if website is down, it always reports healthy now, even if application is down).

Is it possible to specify URL instead of IP:port in network endpoint? If not, what are my alternatives?

enter image description here

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

叹梦 2025-01-26 07:40:32

您可以使用旨在完成该工作的Google API网关,而不是使用Treafik,而您仍然可以使用其背后的负载平衡器。

Instead of using treafik, you can use Google API Gateway which was meant to do that job, while you can still use the load balancer behind it.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文