0

I have the following CNAMES xyz.abc.com, xyz-1.abc.com and xyz-2.abc.com. server body looks like this

server
{
    listen 80 default_server deferred;
    listen [::]:80;
    server_name xyz.abc.com;

    location / {
        proxy_pass http://example.com;
    }
}

All requests are going through and being redirected even though the server name is not in there.

  • Welcome to Stackoverflow! I see the question details, but don't see the question itself, could you declare it explicitly? – Kitsu Jun 25 '20 at 14:30
  • Nginx will use the default server if a matching `server_name` is not found. See [this document](http://nginx.org/en/docs/http/request_processing.html). – Richard Smith Jun 25 '20 at 15:47
  • Also see [this](https://stackoverflow.com/questions/60362642/nginx-doesnt-listen-on-port-80-twice/60362700#60362700) example. – Ivan Shatsky Jun 25 '20 at 17:44

0 Answers0