由于nginx 不支持path_info,需要对配置文件做url重写
server {
listen 80;
server_name localhost;
index index.html index.htm index.php;
root /xampp/htdocs;
autoindex on;
location ~ .*\.php {//这里注意php 末尾不要加$ 要不就隔断不能匹配
fastcgi_pass 127.0.0.1:9000;
set $path_info "";
set $real_script_name $fastcgi_script_name;
if ($fastcgi_script_name ~ "^(.+?\.php)(/.+)$") {//这里拆分下
#set $real_script_name $1;
set $path_info $2;//CI里面我设置的是AUTO 用的PATH_INFO就行
}
fastcgi_param PATH_INFO $path_info;
include /APMServ5.2.6/nginx/conf/fastcgi_params;
}
log_format access '$remote_addr - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" $http_x_forwarded_for';
access_log /APMServ5.2.6/nginx/logs/access.log access;
}
}
今天又配了一遍,发现了一个新的问题
1. LOG日志文件放在后面会报错