简体   繁体   中英

AWS Load Balancer Path Based Routing

I am running a microservice application off of 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. 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. Is this possible without actually having the other service names in the 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. note that for each container you need a target group defined.

You can config loadbalancer to route based on:

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

That's it. cheers.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM