location ~ .*admin.* {
allow 60.191.XX.XX;
deny all;
location ~ \.php$ {
fastcgi_pass 127.0.0.1:9000;
include fastcgi.conf;
fastcgi_index index.php;
}
try_files $uri $uri/ /index.php$is_args$args;
}
参考
需要注意的是,在这个location下也得加入php解析相关的配置,否则php文件无法解析 location ~ .*admin.* {
allow 1.1.1.1;
allow 12.12.12.0/24;
deny all;
location ~ \.php$ {
include fastcgi_params;
fastcgi_pass unix:/tmp/php-fcgi.sock;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME /data/www$fastcgi_script_name;
}
}
这家伙很懒,还没有设置简介