lnmp环境搭建配置

                                           lnmp环境搭建配置

有事环境搭建中,代码并没有错误,却部署在linux上时,却发现老是走不通。

查看了部署的环境也是没有问题,这时我们就需要看看nginx配置了。

下列是我自己的环境部署中的配置,可供大家参考以下,希望对你们有所帮助!

找到nginx的配置路径 /etc/nginx/conf.d/default.conf 

server{
    listen      80;
    server_name localhost;
    index index.php index.html index.htm;
    root  /var/www/juce-project/code;

        location / {
#               root   /var/wwwjuce-project/code;
#               index  index.php index.html index.htm;   #增加index
                try_files $uri $uri/ /index.php?$query_string;
        }
        location ~ \.php {
#               root           /var/www;
                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  /var/www/juce-project/code$fastcgi_script_name;
                fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;
                include        fastcgi_params;
        }
}

猜你喜欢

转载自blog.csdn.net/Ghost_hell/article/details/81507085