来源: 最后更新:24-06-02 12:09:29
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; } } |
我们也可以这样配置
代码如下 | |
server { listen 80; server_name example.com; access_log logs/access.log main; location / { root html; index index.php index.html index.htm; } location ~ ^/download/ { allow 192.168.1.0/24; deny all; index index.php index.do index.html index.htm; 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)?$ { |
夏洛特烦恼为什么喜欢秋雅 夏洛特烦恼为什么秋雅会有艾滋病1、秋雅是夏洛一直爱而不得的初恋情人,所以就算是再次重生,他仍然
迪士尼乐园的真人电影推荐(迪士尼乐园的真人电影推荐一下) xls是什么意思(xls是什么意思啊) 2024武汉硚口数码消费券什么时候结束(汉口数码港在哪) 为什么农民就没有退休呢(为什么农民就没有退休呢)