2014-06-09 65 views
0

我在主頁上有symfony2,現在我試圖在名爲blog的子目錄上安裝WordPress。 我正在使用nginx作爲web服務器與fastcgi。我試圖配置它,但我得到了錯誤500. 有誰知道如何在nginx上正確設置它? 感謝symfony2,wordpress和nginx配置

+0

請張貼您的配置。 –

回答

0
rewrite ^(.*) /app_dev.php last; 

大概應該是這樣的

rewrite ^(.*) /web/app_dev.php last; 

您也可能更願意使用try_files像這樣,否則你的圖片,CSS,JS資產將不會被發現。像

location/{ 
    # try to serve file directly, fallback to rewrite  
    try_files $uri /web/$uri @rewrite; 

    expires 30d; ## Assume all files are cachable 
    location ~ \.php { 
     expires off; 
     fastcgi_pass 127.0.0.1:9000; 
     fastcgi_split_path_info ^(.+\.php)(/.*)$; 
     include fastcgi_params; 
     fastcgi_param SCRIPT_FILENAME          
     $document_root$fastcgi_script_name;   
     fastcgi_param HTTPS    on; 
     add_header X-Frame-Options "ALLOW-FROM https://www.youtube.com/" ; 
    } 
} 

location @rewrite { 
    rewrite ^/(.*)$ /web/app.php/$1 last; 
} 
location /blog { 
    //Wordpress routing here 
} 

無論如何,這是我如何與Magento而不是Wordpress。

+0

感謝您的回答。但它運作不好。你有關於博客部分的想法嗎? –