In order to avoid other people to the non-filing of the domain name resolution to their server IP and the server is broken network, you need to set the Nginx on the IP access to the server, only through the domain name access. The most critical point is to add this line to the server's settings: Listen default, which means that this is the virtual host. For example, if someone accesses your website through an IP or unknown domain name, you want to suppress any valid content, you can return 500. The following: Server { Listen default; server_name _; Return 500;} Of course, according to the above settings, do not let others through the IP access to the server, but should also open one or more real want to access the configuration of the domain name, set as follows: Server { linten; server_name www.941db.com; (Take the Shihai net as an example) ...}
The above describes the Nginx on the set to prohibit through the IP Access server, only through the domain name access, including the aspects of the content, I hope that the PHP tutorial interested in a friend helpful.