I just set up an EC2 instance along with a load balancer and a Route 53 domain. The domain is getactiveapi.com. I set up the load balancer to forward port 80 and 443 to 8080. I have a simple spring boot application running on port 8080. One of my spring boot endpoints is /test. I am trying to hit that endpoint with getactiveapi.com/test with no luck. Am I doing something wrong here?
You should debug this by breaking down the individual components.
The flow is:
Start by getting the IP address of the Amazon EC2 instance and try connecting to it from your web browser. If it works, then the problem lies in a higher layer.
If the application instance is in a private subnet, then first login to another instance in a public subnet of the same VPC, then try connecting to the application instance.
If the application instance is not responding correctly, try logging into the application instance and run curl localhost:8080
. If this works, then the problem probably lies with the Security Group settings. If it does not work, then your application is not running.
To test the Load Balancer, get the DNS Name of the load balancer and try accessing it. If this works, then the problem lies with Route 53. If it does not work, then the problem lies with the load balancer configuration.
Keep moving through the layers (bottom-up) until you discover what is causing the issue.