升级后,Nginx在我的网站上显示空白页面

时间:2014-09-21 15:34:37

标签: nginx ubuntu-14.04

我通过apt-upgrade(运行ubuntu 14.04)升级了我的nginx软件包,现在,当我尝试连接到我的网站时,它只显示一个空白页面(没有错误消息)。

这是我的nginx配置文件的样子:

    server {
        listen 80;
        server_name www.example.com;
        root /home/forge/example.com/public;

        # FORGE SSL (DO NOT REMOVE!)
        # ssl on;
        # ssl_certificate;
        # ssl_certificate_key;

        index index.html index.htm index.php;

        charset utf-8;

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

        location = /favicon.ico { access_log off; log_not_found off; }
        location = /robots.txt  { access_log off; log_not_found off; }

        access_log off;
        error_log  /var/log/nginx/example.com-error.log error;

        error_page 404 /index.php;

        location ~ \.php$ {
            fastcgi_split_path_info ^(.+\.php)(/.+)$;
            fastcgi_pass unix:/var/run/php5-fpm.sock;
            fastcgi_index index.php;
            include fastcgi_params;
        }

        location ~ /\.ht {
            deny all;
        }

    }

server {
    listen       80;
    server_name  example.com;
    return       301 http://www.example.com$request_uri;
}

此外,error.log显示以下消息:conflicting server name "www.example.com" on 0.0.0.0:80, ignored

1 个答案:

答案 0 :(得分:0)

今天第二次我看到使用fastcgi_split_pathinfo而没有设置文档根目录和路径信息设置。它来自哪里?此外,匹配位于\.php$,因此它不会匹配路径信息请求。

我猜你的问题根源在于fastcgi_params已升级。