remove default nginx welcome page when access directly from ip address

I think when you first set up nginx it comes with a "default" virtual host. Did you tried removing that? Did you tried deleting the symlink? A third option would be to add a "deny all;" on the location / of the default virtual host.

I am not exactly sure if that will work and I cannot test it right now. If the above do not work, try this out: http://nginx.org/en/docs/http/request_processing.html#how_to_prevent_undefined_server_names

http://your-server-ip/ is a request with undefined server name. You should be able to block it with:

server {
    listen      80;
    server_name "";
    return      444;
}

You need to remove the file default, located in /etc/nginx/sites-enabled:

rm /etc/nginx/sites-enabled/default

Then restart nginx:

service nginx reload

Tags:

Nginx

Ubuntu