
如何利用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,我们会在看到邮件的第一时间内为您处理!

小修系统博客:一个专注于Windows系统精简与优化的实用性平台
文章标题长度影响排名吗?
Solar:帮助企业快速构建全栈应用程序、自动化工作流的AI应用开发平台