国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 網站 > WEB服務 > 正文

nginx中針對目錄進行IP限制

2020-05-27 13:37:30
字體:
來源:轉載
供稿:網友

   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)?$ { root /opt/nginx/html; astcgi_pass 127.0.0.1:9000; fastcgi_index index.php; include fastcgi_params; }
發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 淮南市| 阳东县| 项城市| 南乐县| 敦煌市| 临高县| 荃湾区| 沁水县| 绥中县| 夏津县| 专栏| 龙川县| 清徐县| 通许县| 广宁县| 织金县| 昌平区| 玉林市| 临颍县| 龙门县| 昔阳县| 获嘉县| 安平县| 长沙市| 玉树县| 孟州市| 蒲江县| 台南县| 密山市| 阳春市| 龙山县| 辰溪县| 四会市| 闸北区| 阳城县| 获嘉县| 万年县| 洮南市| 邹平县| 安阳县| 抚远县|