PHP前端开发

LARADOCK Nginx 配置问题:网站后台空白页面如何解决?

百变鹏仔 2天前 #PHP
文章标签 如何解决

laradock nginx 配置问题剖析

在 laradock 环境中,配置了 nginx 配置文件 laradocker/nginx/sites/app.conf 后仍然无法正常访问网站后台,页面显示空白。如何解决此问题?

解决方案:

编辑 app.conf 文件并按如下配置:

location ~ .php$ {    # try_files $uri /index.php =404;    fastcgi_pass php-upstream;    fastcgi_index index.php;    fastcgi_buffers 16 16k;    fastcgi_buffer_size 32k;    fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;    #fixes timeouts    fastcgi_read_timeout 600;    include fastcgi_params;}location /admin.php {    fastcgi_pass php-upstream;    fastcgi_param SCRIPT_FILENAME /var/www/your_directionary/admin.php;        fastcgi_param PATH_INFO $fastcgi_path_info;        fastcgi_split_path_info ^(.+.php)(.*)$;        fastcgi_param PATH_TRANSLATED $document_root$fastcgi_path_info;        include fastcgi_params;}

这些配置修改解决了以下问题: