Nginx服务器中 Laravel 项目部署到目录 404错误

-- vi usr/local/nginx/conf/nginx.conf

在server {}里加上

location / {
    try_files $uri $uri/ /index.php?$query_string;
}

-- nginx访问根目录以外文件

vi /usr/local/nginx/conf/fastcgi.conf

在PHP_ADMIN_VALUE里添加路径

#fastcgi_param PHP_ADMIN_VALUE "open_basedir=$document_root/:/tmp/:/proc/";

fastcgi_param PHP_ADMIN_VALUE "open_basedir=$document_root/:/tmp/:/proc/:/home/wwwroot/default/";

 

保存,重启nginx

/usr/local/nginx/sbin/nginx
||  lnmp restart

Nginx服务器中 Laravel 项目部署到目录 404错误_第1张图片

 

 

 

 

你可能感兴趣的:(Laravel)