nginx 安装 thinkphp5 配置

nginx.conf

server {
    listen       80;
    server_name s.huailaixx.com;
    charset utf-8;

    location ~ \.php {
        root   /data0/www/test_hlxx/public;
        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;
    }

    location / {
        root   /data0/www/test_hlxx/public;
        index  index.html index.htm index.php;

        if (!-e $request_filename) {
            rewrite ^/(.*)$ /index.php/$1 last;  
            break;
        }
    }
}

php.ini

cgi.fix_pathinfo=1

 

posted @ 2019-08-21 21:23  静心聆听  阅读(1038)  评论(0编辑  收藏  举报