简体   繁体   English

AWS 负载均衡器基于路径的路由

[英]AWS Load Balancer Path Based Routing

I am running a microservice application off of AWS ECS.我正在从 AWS ECS 运行一个微服务应用程序。 Each microservice currently has its own Load balancer.每个微服务当前都有自己的负载均衡器。

There is one main public facing service which the rest of the services communicate with via gateways.有一个主要面向公众的服务,服务的 rest 通过网关与之通信。 Having each service have its own ELB is currently too expensive, is there some way to have only 1 ELB for the public facing service that will route to the other services based off of path.让每个服务都有自己的 ELB 目前太贵了,有没有办法让面向公众的服务只有 1 个 ELB,这些服务将根据路径路由到其他服务。 Is this possible without actually having the other service names in the URL.如果 URL 中实际上没有其他服务名称,这是否可能。 Could a reverse proxy work?反向代理可以工作吗?

I know this is a broad question but any help would be appreciated我知道这是一个广泛的问题,但任何帮助将不胜感激

Inside your EC2 panel go to loadbalancers section, choose a loadbalancer and then in listeners tab, there is a button named view/edit rules , there you set conditions to use a single loadbalancer for different clusters/instances of your app.在您的 EC2 面板 go 到loadbalancers部分,选择一个负载均衡器,然后在listeners器选项卡中,有一个名为view/edit rules的按钮,您可以设置条件以将单个负载均衡器用于您的应用程序的不同集群/实例。 note that for each container you need a target group defined.请注意,对于每个容器,您都需要定义一个target group

You can config loadbalancer to route based on:您可以将负载均衡器配置为基于以下路由:

  1. Http Headers
  2. Path ie: www.example.com/a or www.example.com/b Path即: www.example.com/awww.example.com/b
  3. Host Header(hostname)
  4. Query strings
  5. or even source Ip .甚至source Ip

That's it.而已。 cheers.干杯。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 基于路径的路由在 AWS 应用程序负载均衡器上不起作用 - Path based routing not working on AWS Application load balancer 如何为 AWS Application Load Balancer 使用基于路径的路由 - How to have path based routing for AWS Application Load Balancer 基于 AWS Application Load Balancer (ALB) 路径的路由未按预期运行 - AWS Application Load Balancer (ALB) path based routing not functioning as expected AWS 应用程序负载均衡器路径路由问题 - AWS Application Load balancer path routing issue 节点负载均衡器和基于路径的路由 - node load balancer and path based routing 使用 AWS Application Load-Balancer (ALB) 基于路径路由到外部资源 - Path-based routing to external resource with AWS Application Load-Balancer (ALB) 没有转发路径的 AWS 负载均衡器路径基本路由 - AWS Load Balancer Path Base Routing without forwarding path 基于请求标头的路由(使用AWS Application Load Balancer) - Routing based on request headers (using AWS Application Load Balancer) AWS 应用程序负载均衡器 (ALB) 基于主体的路由 - AWS Application Load Balancer (ALB) Body Based Routing EKS AWS ALB 入口控制器(AWS 负载均衡器控制器控制器)中文件扩展的路径路由 - Path routing for file extension in EKS AWS ALB Ingress Controller (AWS Load Balancer Controller controller)
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM