项目上传到nginx服务器环境下,错了求助

浏览:658 发布日期:2016/12/01 分类:ThinkPHP5专区
项目在本地使用的apache,一切正常。上传到服务器nginx服务器下,就找不到首页了。
nginx配置如下:server
    {
        listen 80;
        #listen [::]:80;
        server_name www.163.com;
        index index.html index.htm index.php default.html default.htm default.php;
        root  /home/wwwroot/www.163.com/Public;

        
        location / {
            #ThinkPHP Rewrite
            if (!-e $request_filename){
                rewrite ^/(.*)$ /index.php/$1 last;
            }
        }
        location ~ \.php($|/){
            #配置PHP支持PATH_INFO进行URL重写
            set $script     $uri;
            set $path_info  "";
            if ($uri ~ "^(.+?\.php)(/.+)$") {
                set $script     $1;
                set $path_info  $2;
            }
            try_files $uri =404;
            fastcgi_pass  unix:/tmp/php-cgi.sock;
            fastcgi_index index.php;
            include fastcgi.conf;
            fastcgi_param  SCRIPT_FILENAME    $document_root$script;
            fastcgi_param  SCRIPT_NAME        $script;
            fastcgi_param  PATH_INFO          $path_info;
        }
指向到public目录中,刷新首页找不到模板文件路径。求助

最佳答案
评论( 相关
后面还有条评论,点击查看>>