Requests between subdomains on same droplet

Posted August 30, 2015 2.7k views
NginxUbuntuServer OptimizationAPIScalingNetworkingVPN

Let’s say I have two subdomains set on one droplet. and makes a request to which then returns data to I’ve tested this and it works just fine, as expected.

Requests are a typical api type of query: and it returns a json response but I’m pretty sure that’s not important.

What I’d like to know, is because both subdomains are on the same droplet, is there a more secure or more efficient way to allow requests to

Further, if I should decide to move to another droplet and therefore another IP address, what then in terms of private requests?

1 comment

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.

Submit an Answer
1 answer

This question was answered by @MrPeppah:

If they are the same and the app is listening you can call localhost considering its on the same machine.

View the original comment