0

As the title suggests, I have a public ip address (it's the address for an azure VM running ubuntu server fyi) which has an nginx server listening to requests on port 80.

Entering this public address into the browser succeeds in receiving a response from nginx, like so:

enter image description here

The problem is when I assign it an alias in the hosts file (in windows). For whatever reason, it just loads endlessly:

enter image description here

Any help on the matter would be really welcome - I'm stumped! Thanks in advance.

  • Can you please try ping www.example.com from that computer? – Dusan Bajic Oct 12 '15 at 18:17
  • If that IP address is correct (and accessing it does give the basic nginx page, so presumably it is) then the problem is not with the webserver as I can add such a line in my /etc/hosts and I still get the nginx page when loading www.example.com in my browser. Do you perhaps have a proxy configured, which will not know about your /etc/hosts entry and hence try to load the "real" www.example.com? – wurtel Oct 13 '15 at 8:09
0

The problem was that I was, rather stupidly, following an outdated tutorial.

I used a different, more up to date tutorial and everything's working fine. The problem lay in the fact that I should've been setting up my server in the sites-available section, and then linking them in the sites-enabled directory. My bad!

Thanks for your time :)

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.