禁止访问功能配置
nginx.conf中的http{}中的server{}的location ..{}中:
location / {
#拒绝访问,192.168.16.0网段的同学都无法访问 /24是子网掩码的意思
deny 192.168.16.0/24;
root html;
index index.html index.htm;
}
404页面
nginx.conf中的http{}中的server{}中:
#error_page 404 /404.html;
转载于:https://www.cnblogs.com/open-yang/p/11255853.html
最后
以上就是难过香菇最近收集整理的关于nginx配置之禁止访问和404错误功能配置的全部内容,更多相关nginx配置之禁止访问和404错误功能配置内容请搜索靠谱客的其他文章。
本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
发表评论 取消回复