Welcome! Log In Create A New Profile

Advanced

Nginx unable to match server_name if the server can not resolve the host

Posted by eramirem 
Nginx unable to match server_name if the server can not resolve the host
October 24, 2013 05:39PM
I have a server block with the following configuration:

server {
...

listen *:80;
server_name ~^query.+\.example.\com$;
...
}

If the server is unable to resolve hosts like query.dev.example.com (Unknown host), nginx will NOT match this host against the previous server block, and will execute the default server block.
So defining server names requires that the host specified can be resolved in the local server?

Thanks.
ER
Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 281
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 500 on July 15, 2024
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready