|
nginx配置如下
server {
listen 80;
server_name localhost 127.0.0.1;
root D:/upupw/htdocs;
index index.html index.htm index.php;
location ~ /longphp {
root D:/mycode;
}
location ~ ^.+\.php {
fastcgi_pass bakend;
fastcgi_index index.php;
fastcgi_split_path_info ^((?U).+\.php)(/?.+)$;
fastcgi_param PATH_INFO $fastcgi_path_info;
fastcgi_param PATH_TRANSLATED $document_root$fastcgi_path_info;
include fastcgi.conf;
}
error_log logs/aaa.log debug;
}这时访问 http://127.0.0.1/longphp
会提示下载,D:/mycode/longphp里面有index.php |
|
|
沙发#
发布于:2015-11-01 12:25
因为你现在php解析的范围是在全局root的htdocs目录,新的别名目录没做php解析设置。
|
|