I have a website on a VPS.
The issue I am having is that when I enter the IP of the server, it links to the website.
Even when entering mail.domain.com, it does the
Put this at top of your /etc/nginx/conf.d/SERVER_IP_ADDRESS.conf
file and comment everything what is below it.
#disabling accesing server by ip address
server {
listen SERVER_IP_ADDRESS:80 default;
server_name _;
return 404;
}
Then restart your Nginx server (on Ubuntu it is done by service nginx restart
this command)
Now when you will put your server's ip address to browser url field you will get 404 error.