php语言下,配置nginx

server {
listen 80;
server_name b.test.com;
#罪恶的来源就是下面的一行
root "D:\phpStudy\PHPTutorial\WWW\WWW\test";
location / {
// 以下者三行是配置nginx以pathinfo形式访问
if (!-e $request_filename){
rewrite ^/(.*) /index.php last;
}
index index.html index.htm index.php;
#autoindex on;
}
location ~ \.php(.*)$ {
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_split_path_info ^((?U).+\.php)(/?.+)$;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param PATH_INFO $fastcgi_path_info;
fastcgi_param PATH_TRANSLATED $document_root$fastcgi_path_info;
include fastcgi_params;
}
}
————————————————
版权声明:本文为CSDN博主「蜗牛使劲冲」的原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接及本声明。
原文链接:https://blog.csdn.net/wt1286331074/java/article/details/80970157

猜你喜欢

转载自www.cnblogs.com/xinyixuan/p/12626352.html