enter image description here
I made an aws infrastructure like the above image. Let just focus on AZ1. I hosted font-end react app on ec2 that sit between internet-facing load balancer and internal load balancer. Behind internal load balancer are ec2 which hosts epxress app for backend logic. I tested that inside VPC, front end , backend, RDS can communicate with each other. My browser can access react app through internet-facing load balancer. In react app, I point to backend server by using internal load balancer dns name. I want to clarify that when user interact on front end site, let’s say pressing login button, then the request will be sent to internal load balancer. But dns name of internal load balancer will be resolved to private ip address, which cannot be routed over internet. Some documents like this one https://docs.aws.amazon.com/ja_jp/elasticloadbalancing/latest/classic/elb-internal-load-balancers.html, suggest the architecture like my case. How internal this architecture actually work ?
I first try to point to express app using server’s private ip address but it does not work because private IP address is not recognized in internet. But if I tried to use dns internal load balancer, then it would work. Still confused because dns still be resolved to private ip address.
nguyen thanh is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.