nginx如何針對目錄進行IP限制
2016-08-18 09:03:34
11461
Nginx phpmyadmin 針對內網ip用戶開放、外網ip用戶關閉
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;
}
}