2014-09-21 61 views
0

我通過apt-upgrade(運行ubuntu 14.04)升級了我的nginx包,現在,當我嘗試連接到我的網站時,它只顯示一個空白頁面(沒有錯誤消息)。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

回答

0

今天第二次我看到使用fastcgi_split_pathinfo沒有設置文檔根目錄和路徑信息設置。這是從哪裏來的?此外,比賽是\.php$,所以它不會匹配路徑信息請求。

我猜測你的問題的根源在於fastcgi_params已經升級。

0
location ~ \.php$ { 
     include fastcgi_params; 
     fastcgi_index index.php; 
     fastcgi_pass unix:/var/run/php5-fpm.sock; 
     fastcgi_split_path_info ^(.+\.php)(/.+)$; 
     fastcgi_param PATH_INFO $fastcgi_path_info; 
     fastcgi_param PATH_TRANSLATED $document_root$fastcgi_path_info; 
     fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; 
    } 

我修改這個樣子,但還是問題仍然存在

+0

這是不是一個真正的答案,如果你有修訂,令你應該修改你原來的問題。 – Dayo 2014-09-25 18:23:03