简体   繁体   English

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

[英]Nginx showing blank page on my website after upgrading

I upgraded my nginx package via apt-upgrade (running ubuntu 14.04) and now, when I've tried to connect to my website, it only shows a blank page (no error message). 我通过apt-upgrade升级了nginx软件包(运行ubuntu 14.04),现在,当我尝试连接到我的网站时,它仅显示空白页面(无错误消息)。

This is what my nginx configuration file looks like: 这是我的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;
}

Also, the error.log shows this message: conflicting server name "www.example.com" on 0.0.0.0:80, ignored 此外,error.log还会显示以下消息: conflicting server name "www.example.com" on 0.0.0.0:80, ignored

Second time today I'm seeing the use of fastcgi_split_pathinfo without setting a document root and path info setting. 今天第二次我看到使用fastcgi_split_pathinfo而不设置文档根目录和路径信息设置。 Where does that come from? 那是哪里来的 In addition the match is on \\.php$ , so it won't ever match on path info requests. 另外,匹配项位于\\.php$ ,因此它永远不会与路径信息请求匹配。

I'm guessing there lies the root of your problem as fastcgi_params has been upgraded. 我猜这是因为fastcgi_params已升级,这是您问题的根源。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM