Reputation: 413
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
Upvotes: 0
Views: 752
Reputation: 1549
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:
Http Headers
Path
i.e: www.example.com/a or www.example.com/bHost Header(hostname)
Query strings
source Ip
.That's it! cheers.
Upvotes: 4