These days to view the CNZZ statistics backstage See, my IP was two unknown domain name binding, in order to avoid being harmonious by the celestial,
Can be set on Nginx to prohibit IP access to the server, only through the binding domain name access (at the same time set the unbound domain name return 500 error or jump to my drop domain name home)
method is relatively simple,
Open nginx.conf
Step1 Binding website Domain name
Add a domain name to the server segment server_name row
server { a; server_name m114.org www.m114.org; Index index.html index.htm index.php; /data/htdocs/www;}
Step2 setting forbidden IP and unbound domain name access
Add the following code to the configuration file (entire paragraph)
① return 500 error
server { default; server_name _; return - ;}
② jump to your own domain homepage
server { default; server_name _; ^ (. *) http://m114.org permanent;}
Step3 Restart Nginx
In this way, the domain name and IP access not bound in Nginx will return 500 error or jump to my domain home page
Nginx is forbidden to access the server via IP, unbound domain name