Nginx 禁止IP访问如何实现

如题所述

server { listen 80; server_name null; access_log off; location / { root /dev/null; log_not_found off; } }

添加一个默认主机,用户就不可以直接用IP访问,只能用域名

温馨提示:内容为网友见解,仅供参考
无其他回答
相似回答
大家正在搜