2017-03-01 62 views
1

我把我的web服務器apache2切換到centos 7上的nginx,現在主要index.php顯示一個空白頁面,但wp-admin工作正常。在Web控制檯中,我可以看到200個響應。我啓用了wp調試,但沒有運氣。這裏是我的主機文件wordpress空白頁與nginx

server { 
    root /var/www/html; 
    index index.php index.html index.htm; 
    server_name new-site.com; 
    location = /favicon.ico { 
    log_not_found off; 
    } 
    location/{ 
    try_files $uri $uri/ /index.php?$args; 
    } 
    location ~ \.php$ { 
     try_files $uri =404; 
     fastcgi_split_path_info ^(.+\.php)(/.+)$; 
     fastcgi_pass unix:/var/run/php-fpm/php-fpm.sock; 
     fastcgi_index index.php; 
     fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; 
     include fastcgi_params; 
     } 
    } 

回答

0

這個網站是爲我工作:new-staging.opploans.com 請嘗試清理瀏覽器中的緩存,或者如果您使用CDN,清除內容,然後再試一次。

+0

千恩萬謝。我得到了解決方案,現在它的工作我改變了配置,並在我的答案更新解決方案 – abaid778

3

谷歌上搜索我的那麼多小時就到了解決方案對我來說這是工作的配置改變include fastcgi_params;include fastcgi.conf;

location ~ \.php$ { 
    try_files $uri =404; 
    fastcgi_split_path_info ^(.+\.php)(/.+)$; 
    include fastcgi.conf;  
    fastcgi_index index.php; 
    fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; 
    #include fastcgi_params; 
fastcgi_pass unix:/var/run/php-fpm/php-fpm.sock; 
} 

}

+0

是的,這工作。感謝abaid778 –