how to disable direct access to a web site by ip address

前端 未结 8 1371
滥情空心
滥情空心 2021-01-31 02:17

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

8条回答
  •  后悔当初
    2021-01-31 03:06

    you can return any error you find suitable. A list of errors can be found here List_of_HTTP_status_codes

    server {
        listen      x.x.x.x:80;
        server_name x.x.x.x;
        return      404;
    }  
    

提交回复
热议问题