Nuwanda
By:
Nuwanda

Requests between subdomains on same droplet

August 30, 2015 1.1k views
API Networking Scaling Server Optimization VPN Nginx Ubuntu

Let's say I have two subdomains set on one droplet.

app.mydomain.com and api.mydomain.com

app.mydomain.com makes a request to api.mydomain.com which then returns data to app.mydomain.com. I've tested this and it works just fine, as expected.

Requests are a typical api type of query: http://api.mydomain.com/products?category=shoes 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 api.mydomain.com.

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

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

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

Have another answer? Share your knowledge.