来源: 最后更新:24-06-02 12:09:31
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)?$ { |
李京霖悦然医美:选择什么吸脂方式更好 虽说吸脂术可以减少局部的皮下脂肪,但并不是什么部位都可以吸脂
怎么解决留守儿童问题如何解决留守儿童问题 实探安徽铜陵坍塌居民楼:建成二十余年历经三次改造,仍未阻止悲剧发生 2024济宁太白湖新区飞机防治时间+区域 济宁太白湖新区最新新闻 2024第36届潍坊金宝汽车文化博览会时间