Nginx catching all domains without wildcard

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
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
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
all subdomains ??


In the configuration you provided, there are 3 server blocks:

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)
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
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 C. [email protected]

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs