系统之家 - Windows操作系统&装机软件下载网站!

当前位置: 首页  >  教程资讯  >  电脑教程 nginx中针对目录进行IP限制

nginx中针对目录进行IP限制

时间:2023-06-02 16:16:41 来源: 人气:

   nginx phpmyadmin 针对内网ip用户开放、外网ip用户关闭(在前面的配置中,location ~ ^/目录/使用正则, 优先级高于location /的配置,所以nginx无法对首页进行解析),server {,listen 80;,server_name example.com;,access_log logs/access.log main;,location / {,root html;,index index.php index.html index.htm;,},location ~ ^/phpmyadmin/ {,allow 192.168.1.0/24;,deny all;,location ~ .*.(php|php5)?$ {,root /var/mailapp/nginx/html;,fastcgi_pass 127.0.0.1:9000;,fastcgi_index index.php;,include fastcgi_params;,},},location ~ .*.(php|php5)?$ {,root /opt/nginx/html;,fastcgi_pass 127.0.0.1:9000;,fastcgi_index index.php;,include fastcgi_params;,},},  我们也可以这样配置,

作者

教程资讯

电脑教程排行

系统教程

系统主题