tp5项目部署centos7 解决pathinfo路径
将项目部署到远程服务器上以后,无法以pathinfo访问,此时需要配置一下nginx的配置文件(/etc/nginx/conf.d/default.conf),配置如下:
location / {
root /usr/share/nginx/html;
index index.html index.html;
if (!-e $request_filename) {
rewrite ^/dry/public/(.*)$ /dry/public/index.php?s=$1 last;
}
}
location ~ \.php {
root /usr/share/nginx/html;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_split_path_info ^(.+\.php)(.*)$;
fastcgi_param PATH_INFO $fastcgi_path_info;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}