Default host is being ignored?

nrahl nginx-forum at
Sun Jun 8 17:50:18 UTC 2014

I created a default conf file:

server {
    listen 80 default;
    listen 443 default;
    server_name "";
    return 444;

and linked it in sites-enabled.

The other server is declared with:

server {
   listen 80;
   listen 443 ssl;


Accessing the https://xx.xx.xx.xx (the IP address) uses the
host instead of using the default, which should reject the request. The
browser is sending the host as "xx.xx.xx.xx". This should not match the file. So why is it it not using the right server?

I've also tried leaving server name blank and adding "ssl" after 443 in the
listen directive, but it still ignores the default server and uses the one instead.

Posted at Nginx Forum:,250732,250732#msg-250732

More information about the nginx mailing list