nginx default server not used

valinor nginx-forum at
Sat Jun 9 08:41:23 UTC 2012


I have found another possible cause for nginx to ignore default server
I have encountered it just now, and it is not your case, but maybe it
would be helpful for someone

At example:

server {
  listen 80 default_server;
  server_name default.domain.dom;

server {
  listen <particular.ip>:80;
  server_name some.server.domain.dom;

In this case, listening schema for the default server is _not_the_same_
as for another server.
Considering the fact that we have described a server with the particular
ip address, our default server for that ip (although it is listening on
all IPs) would be ignored, and all queries to that particular ip, even
with "Host: default.domain.dom", would be directed to
"some.server.domain.dom" as it becomes a default (first-described)
server for this listening schema.
We have to explicitly describe "listen <particular.ip>:80" on the
default server to enable it for this schema.

WBW, valinor

Posted at Nginx Forum:,222679,227377#msg-227377

More information about the nginx mailing list