Nginx catching all domains without wildcard

B.R. reallfqq-nginx at
Mon Dec 28 12:41:16 UTC 2015

In the configuration you provided, there are 3 server blocks:
- 80
- 443 (default server)

There is no server block defined for (you main config file
has an include directive for a /etc/nginx/ file which is
commented though), thus a default server block will be selected.

On port 443, for all IP addresses, the server block will be
chosen as it is defined as being the default.
On port 80, there is no default port defined, thus the first (and only) one
will be used.
On 8081 for the localhost IP address, as for 80, there is no
default port so the first (and only) server block defined for the IP:port
pair will be selected as the default.

There is no magical behavior, please make sure you understand the docs.
There is even a webpage dedicated to server names:
*B. R.*

On Mon, Dec 28, 2015 at 3:52 AM, Xavier Cardil Coll <info at>

> My Nginx config is catching all subdomains without specifying a wildcard.
> I have created an special config for each subdomain, but seems that all
> subdomains pass trough the main domain configuration. I have discovered
> this by removing the subdomains configuration files from nginx.conf and
> watching how it still catches all the subdomains, so when I send a request
> to, instead of Nginx catching the subdomain configuration,
> goes through the main domain configuration. This is causing trouble with
> applying mod_pagespeed individually to each of the sites and also managing
> the GA universal code.
> The config for the main domain is this :
> http config :
> If I haven't setup a wildcard, how come the main domain config is catching
> all subdomains ??
> Thanks
> _______________________________________________
> nginx mailing list
> nginx at
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the nginx mailing list