What is nginx server_name and how it works?

Nginx server_name is a special directive used for server block configuration selection. Let say you have multiple server sections in your Nginx config file:

server {
 listen 80;
 server_name test.com;

 ...
}

server {
 listen 80;
 server_name example.com;

 ...
}

When we get incoming request with test.com “Host”  …

Continue reading  »