tp5项目部署centos7 解决pathinfo路径

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;
        }
     }  

tp5项目部署centos7 解决pathinfo路径_第1张图片

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;
}

tp5项目部署centos7 解决pathinfo路径_第2张图片

你可能感兴趣的:(Linux服务器的配置,维护,环境搭建和安全配置)