Hello everyone, As I was following the tutorial for setting up a production-grade nodejs app on ubuntu 18.04, I came across some difficulties. Here is the link for the tutorial: https://www.digitalocean.com/community/tutorials/how-to-set-up-a-node-js-application-for-production-on-ubuntu-18-04. Everything works great except that I have two nodejs apps running on two separate droplets within the same VPC. Both droplets are set the way following the tutorial link I mentioned above. I have two different domains. Each domain is pointed to each one of the droplets. The apps work individually as they should, meaning they can be reached out from their domain. The two droplets are supposed to talk to each other. Right now they can talk using the each other’s domain. But I want them to talk to each other using their private ip addresses since they are on the same VPC. When I run curl http://PRIVATE_IP_2 from droplet_1, the response comes from the app running on the droplet. But as soon as I add a path to it, nginx responds with its 404 default page content. Like curl http://PRIVATE_IP_2/api/internal would give me that nginx 404 page content and curl http://PRIVATE_IP_2 will return the app’s response. I really need your help make my work with external domain while they still communicate other the private network. Thank you
These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.
Click below to sign up and get $100 of credit to try our products over 60 days!