2024年09月27日 建站教程
nginx如何限制网站来源ip访问,下面web建站小编给大家详细介绍一下实现代码!
nginx配置如下:
server {
listen 80;
server_name www.lmcjl.com;
location / {
root html;
index index.php index.html index.htm;
}
//限制ip访问
location / {
deny 192.168.0.4;
allow 192.168.1.0/16;
allow 10.0.0.0/24;
deny all;
}
}
本文链接:http://so.lmcjl.com/news/14046/