server { listen 80; server_name null; access_log off; location / { root /dev/null; log_not_found off; } }
添加一个默认主机,用户就不可以直接用IP访问,只能用域名