2011-04-11 125 views
0

試圖讓Nginx和Wordpress玩得很好,但它似乎還沒有很好地理解對方,特別是在漂亮的URL和重寫方面。Nginx,Wordpress和URL重寫問題

我在我的配置文件底部的nginx(從WP的Nginx的維基頁面得到它)下面的代碼片段,我不斷收到這個錯誤信息在我的錯誤日誌,這讓我覺得它甚至不試圖重寫位置。

2011/04/11 09:02:29 [error] 1208#1256: *284 "c:/local/path/2011/04/10/hello-world/index.html" is not found (3: The system cannot find the path specified), client: 127.0.0.1, server: localhost, request: "GET /2011/04/10/hello-world/ HTTP/1.1", host: "dev.local:83" 

如果有人可以幫助給我方向或指針或鏈接,或建議,因爲我認真地卡住,這將是驚人的。謝謝!

NGINX

worker_processes 1; 
pid  logs/nginx.pid; 

events { 
    worker_connections 64; 
} 

http { 
    include  mime.types; 
    default_type application/octet-stream; 

    sendfile  on; 
    keepalive_timeout 65; 

    #gzip 
    gzip on; 
    gzip_http_version 1.0; 
    gzip_comp_level 2; 
    gzip_proxied any; 
    gzip_min_length 1100; 
    gzip_buffers 16 8k; 
    gzip_types text/plain text/html text/css application/x-javascript text/xml application/xml application/xml+rss text/javascript; 

    # Some version of IE 6 don't handle compression well on some mime-types, so just disable for them 
    gzip_disable "MSIE [1-6].(?!.*SV1)"; 
    # Set a vary header so downstream proxies don't send cached gzipped content to IE6 
    gzip_vary on; 


    server { 
     listen  83; 
     server_name localhost dev.local; 
     root c:/local/path; 
     index index.php; 

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

     #pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000 
     location ~ \.php$ { 
      fastcgi_pass 127.0.0.1:521; 
      fastcgi_split_path_info ^(.+\.php)(/.+)$; 
      fastcgi_intercept_errors on; 
      fastcgi_index index.php; 
      fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; 
      include  fastcgi_params; 
     } 
    } 

} 

回答

0

喜歡你指定被翻譯成一個絕對路徑/ cygdrive/C/-path即使你沒有cygwin的安裝。對於Windows,我建議你儘可能使用相對路徑。相對於nginx目錄。