
如何利用nginx限制网站来源IP访问,下面web建站小编给大家简单介绍一下nginx的具体配置方法!
具体代码如下:
location ~ ^/mysql_loging/ {
allow 192.168.0.4;
deny all;
}
location ~ .*\.(php|php5)?$ {
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
}
限制IP或IP段访问的配置:
location / {
deny 192.168.0.4;
allow 192.168.1.0/16;
allow 10.0.0.0/24;
deny all;
}
上面是“如何利用nginx限制网站来源IP访问”的全面内容,想了解更多关于 前端知识 内容,请继续关注web建站教程。
当前网址:https://m.ipkd.cn/webs_4518.html
声明:本站提供的所有资源部分来自互联网,如果有侵犯您的版权或其他权益,请发送到邮箱:admin@ipkd.cn,我们会在看到邮件的第一时间内为您处理!

盘古大模型 5.5:一款专注于解决实际产业问题,推动千行百业的智能化升级
PetiteVue文档官网介绍
教育培训移动端网站模板(html+css+jquery)
丢盖网免费logo设计生成官网首页入口