1

My two ec2 instances are on the same subnet and I have configured the security group such that they can communicate with each other (pinging each others private ip adresses and connecting via telnet).

The frontend instance is hosting an angular app on nginx, the backend instance is hosting a spring boot app. The angular app makes http requests to the spring boot app and shows the results. Pretty simple stuff. Now when I made the http requests to go to the public ip address of the backend instance everything worked great. When I changed them to go to the private ip address it stopped working and I'm getting request timeouts. Why is this happening? I can clearly access the private ip address via telnet but angular cannot.

1 Answers1

1

Your Angular application runs on client's browser. Request to backend app is made from the client's browser which cannot access the backend instance by Private IP.

Suraj
  • 602
  • 3
  • 16