Why is nginx default_server masking a better match?
Solution 1:
The server_name
is an exact match, unless you use wildcards or regular expression syntax. See this document for details.
The domain B.domain.ddns.net
does not match any of your existing server_name
expressions, so the default server will be used instead.
If there is no listen
directive with a default_server
modifier, the first server
block (with a matching IP:PORT) will be used. Without knowing the load order of your configuration, we don't know which one that was (possibly site C as it mysteriously stopped working). Use nginx -T
to see the entire configuration as read by nginx
.
There is no comma separator in the server_name
directive. You site B statement should perhaps be:
server_name B.domain.ddns.net B.domain B;