在Nginx下wordpress的錯誤解決
因為有新的VPS,所以要將原來架設在Apache2上笨笨包的天空網站搬到新的Nginx上,但是這一搬就出現了不少的問題,最典型的就是permalinks固定網址出錯:
sent in stderr: "Primary script unknown" while reading response header from upstream
為了解決這個問題,系統被我re-install不知道多少次還是無法解決,上網查,各式各樣的回答都有,笨笨包也都一一的實驗,最後終於解決了。
以下是笨笨包的天空網站的conf內容,其它什麼都沒改,就只是安裝後預設的設定:
server { root /home/590103/public_html; index index.html index.htm index.php; server_name 590103.idv.tw www.590103.idv.tw; access_log /home/590103/logs/590103.idv.tw.access.log; error_log /home/590103/logs/590103.idv.tw.error.log; location / { try_files $uri $uri/ /index.html; } location /blog/ { try_files $uri $uri/ /blog/index.php?$args; } rewrite /blog/wp-admin$ $scheme://$host$uri/ permanent; location ~ \.php$ { fastcgi_split_path_info ^(.+\.php)(/.+)$; fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; include fastcgi_params; }
}