nginx 之黑白名单

要想限制某个ip访问

在/etc/nginx/nginx.conf里的location里
添加

deny 172.16.3.55
allow all

(禁止172.16.3.55访问,允许其他ip访问)

在这里插入图片描述

allow 172.16.3.55
 deny all

(只允许172.16.3.55访问,禁止其他ip)
在这里插入图片描述

猜你喜欢

转载自blog.csdn.net/weixin_45663905/article/details/107319876