Reputation: 21
I have deployed a spring boot app in AWS EC2. My application.properties.
server.servlet.context-path=/demo
server.port=8098
I can access the app via Public DNS:8098/demo
Now i want to use ELB. How can i tell load balancer to point to Public DNS:8098/demo ? when the Public DNS of load balancer is hit?
I did a try but i don't know where to add the context root and 8098 port number
Upvotes: 0
Views: 980
Reputation: 135
The only way to do this is to create Target Group. Here are the full docs https://docs.aws.amazon.com/elasticloadbalancing/latest/application/load-balancer-target-groups.html
To create the Target group go to EC2 service -> choose Target Groups on the left menu. Choose Create target group. Then fill all fields: instance name, port (8098) and others.
Then, create a Load Balancer (LB), and point that LB to previously created Target Group.
After that, you can check your targets in the tab "Targets". If your target status is "Healthy", in your browser go to the {Load Balancer DNS}/demo and you'll see your app page.
Upvotes: 0