nginx default server not used

Maxim Dounin mdounin at
Sun Feb 19 21:03:00 UTC 2012


On Sun, Feb 19, 2012 at 02:23:32PM -0500, rj wrote:

> Hi,
> I am currently evaluating nginx as an apache replacement and came across
> some (at least for me) odd behavior and hope someone can explain to me
> what is happening.
> nginx is ignoring my default server and instead picks a directory of a
> deleted server as the default. If I point some random domain at the
> server address for which no server configuration exists, nginx servers
> the directory of the removed server config instead the on defined as the
> default server.
> OS: Debian Squeeze
> nginx version: nginx/1.0.12 dotdeb repository
> nginx config:
> The directory served by nginx as the default is not mentioned anywhere
> in /etc/nginx. I added it previously as an additional server but have
> deleted it. Somehow nginx still remembers the server and servers it as
> the default for unknown server names.

Most likely reason is that you've forgot to reload nginx config, 
or reload failed for some reason (take a look at nginx error 

The config you've posted suggests there is indeed syntax error in 
it (missing "}" at the end), though it may be unrelated problem 
introduced during posting.  Running "nginx -t" will help to 
identify syntax errors, looking into error log will cover other 
possible cases like port conflicts and so on.

Maxim Dounin

More information about the nginx mailing list