How to configure nginx not to show if IP is used in the brow

hi

my linode runs few websites using nqinx. If I use ip address in a browser nginx displays one of the sites. I think it's the last one I set up.

How can I make it so nothing is displayed?

Thank you

R.

Conf file for the site that is displayed if ip is used.

server {
    listen   80;
    server_name yota.rsness.com;
    access_log /srv/www/wordpress/zxc.zxcv.com/logs/access.log;
    error_log /srv/www/wordpress/zxc.zxcv.com/logs/error.log;

    location / {
        root   /srv/www/wordpress/zxc.zxcv.com/public_html;
        try_files $uri $uri/ /index.php?q=$uri&$args;
        index  index.html index.htm index.php;
    }

    location ~ \.php$ {
        include fastcgi_params;
        fastcgi_pass  127.0.0.1:9000;
        fastcgi_index index.php;
        fastcgi_param  SCRIPT_FILENAME  /srv/www/wordpress/zxc.zxcv.com/public_html$fastcgi_script_name;
    }
}

2 Replies

Set one of the server{} blocks – perhaps one that's just a "Move along, nothing to see here" page -- as the default.

listen 80 default_server;

@hoopycat:

Set one of the server{} blocks – perhaps one that's just a "Move along, nothing to see here" page -- as the default.

listen 80 default_server;

I had the default option in the server{} block of the web that was displayed when using ip. So I removed it hopping it would fix it.

Your suggestion works. Thank you.

R.

Reply

Please enter an answer
Tips:

You can mention users to notify them: @username

You can use Markdown to format your question. For more examples see the Markdown Cheatsheet.

> I’m a blockquote.

I’m a blockquote.

[I'm a link] (https://www.google.com)

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct