Nginx server_name command being ignored

Francis Daly francis at daoine.org
Sat Dec 15 11:05:58 UTC 2012


On Fri, Dec 14, 2012 at 06:54:58PM -0500, constable1 wrote:

Hi there,

> I also tried "curl -i http://test/" and I get the
> output as the code that makes up the html of my page, so it appears that
> nginx is working fine, but when I try going to http://test/ on another
> machine on my home network then I get nothing,

Exactly the same as the last time:

What is the output of

  curl -i http://test/

? Do that from whatever machine you want things to work from. The output
is unlikely to be "nothing", and is likely to give an indication of the
first problem.

And you can still test the nginx side without fixing name resolution by
looking at the output of

  curl -i -H Host:test http://127.0.0.1/

where "127.0.0.1" should be replaced with "an ip address that the nginx
server is listening on".

Note that 127.0.0.1 is a special address which means (roughly) "this
machine only". And so is unlikely to work from any other machine.

The server{} block that has "server_name test" would need to "listen"
on a non-127.0.0.1 address for it to be accessible

> I agree that this must be
> some kind of DNS issue here, but how does one go about fixing it?

"Big" fix is "whatever your network does". "Small" fix is /etc/hosts.

	f
-- 
Francis Daly        francis at daoine.org



More information about the nginx mailing list