I am deploying three websites to a Digital Ocean droplet. As far as I can tell, everything is set up and configured correctly on the droplet. The nginx block files in /sites-available are identical except for the root directory and the server_name . Nginx responds with its default page via its server IP address.
The issue I'm having is that two of the three sites are currently hosted on other platforms. For illustration, let's use example.com. I have nginx configured to accept example.com, but example.com is hosted on another platform, so I altered my Windows hosts file to the server's IP for example.com
One of the three sites does not exist, the domain is not registered. Nginx happily serves that page with my Windows hosts alteration. The other two do not.
If I ping example.com, I get a response from my server IP. But typing in example.com into a browser will not resolve. I imagine I'm misunderstanding something fundamental about the DNS happening here, but it's beyond my knowledge and I'm not even sure what to Google without all this explanation.
Is there any way for me to test what example.com will look like on my new droplet without having to change the DNS from the old hosting? Thank you in advance.
[EDIT It has to be a DNS issue of some kind, because I just altered the DNS records of one of my other domains, copied the block file and modified it for the new domain, and it works perfectly. It has to have something to do with how Windows hosts does lookups, but I cannot fathom what.]
Source: r/nginx · by /u/KaedenCraft