Reputation: 105
I am trying to configure an AWS Application Load Balancer to load balance multiple applications (4) running on two EC2 instances.
My application architecture is as follows:
I would like to use HTTP port 80 and create an entry for each of these ports.
I previously tried the classic load balancer configuration but this does not support listening for more than one HTTP port 80 entry.
I have never used the Application Load Balancer before, but have tried configuring a target group rule to test it out. My rule checks for the path /applicationName
and the port to check is 8081 with the idea that my application url would include http://"ipaddress":8081/applicationName
.
Ideally I would like to create a rule for each application.
Does anyone have any insight as to if this type of load balancer can even be used for this set up and if so, how to set it up properly?
Upvotes: 3
Views: 4359
Reputation: 200562
You would have to create a target group for each application, like so:
Then on the ALB you would create 4 rules for port 80, like so:
Each application would need to be configured to serve the appropriate content at the specified path. I.e application1 would need to be configured to serve content at http://domain-name:8080/application1 etc.
You also have to configure a default path for port 80 in the ALB. I'm not sure what you would want that configured for in this instance, perhaps point it to one of your applications as the "default" if no path is specified.
Upvotes: 5