server{
..
server_name some_other_domain_name.com;
..
}
I have mapped my domain name to the public IP of my VM via godaddy.
When I enter the domain name in the browser, then it is able to access the website hosted on the VM (via nginx). However, I was expecting that the request will not be allowed by nginx because the server_name property is set to some_other_domain_name.com
Does nginx not check the server_name property?
server_nameis always used. The issue is likely with your default server block as explained below. – Tero Kilkanen Feb 16 '22 at 07:31