nginx+php限制某个IP访问
location ~ .*xxxx.* {
allow 127.0.0.1/8;
deny all;
# 你原PHP文件配置复制一份
location ~ [^/]\.php(/|$)
{
try_files $uri =404;
fastcgi_pass unix:/tmp/php-cgi-72.sock;
fastcgi_index index.php;
include fastcgi.conf;
include pathinfo.conf;
}
}Last updated