2013-05-11 55 views
2

blog.mydomain.com/phpinfo.php(它簡單顯示phpinfo())工作正常。沒有指定輸入文件Nginx WordPress安裝

我錯過了什麼?我的博客的

目錄根目錄是/ usr /共享/ nginx的/ HTML /博客/

我使用的Centos。

/etc/nginx/nginx.conf是默認值。

/etc/nginx/conf.d/virtual.conf:

server { 
    server_name blog.fuzzybee7.com www.blog.fuzzybee7.com; 

    include /etc/nginx/conf.d/global/php.conf; 

    root /usr/share/nginx/html/blog; 
} 

/etc/nginx/conf.d/global/php.conf:

location ~ \.php$ { 
    fastcgi_pass 127.0.0.1:9000; 
    fastcgi_index index.php; 
    fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; 
    include  fastcgi_params; 
} 

回答

1
在/ etc

/nginx的/ conf.d /全球/ php.conf試試這個

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

location ~ \.php$ { 
    include fastcgi_params; 
    fastcgi_pass 127.0.0.1:9000; 
} 
+0

謝謝你,但它並沒有在所有 – ericn 2013-05-11 08:30:33

+1

確定工作!你有沒有檢查這個https://github.com/rtCamp/easyengine – Strik3r 2013-05-11 17:21:02

0

@ Faishal的答案應該已經很好,但他做了一個小錯誤,他用$args代替$uri$request_uri,所以請嘗試這樣做;

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

這應該正確地傳遞的URI的index.php

相關問題