在nginx配置文件中試圖找出位置塊很困難。這是我有:在nginx中找不到位置塊
server {
listen 80;
server_name _;
access_log /var/log/nginx/example.com.access_log;
error_log /var/log/nginx/example.com.error_log warn;
root /var/www/root;
index index.php index.htm index.html;
fastcgi_index index.php;
location /wp/ {
root /var/www/wordpress;
index index.php index.htm index.html;
fastcgi_index index.php;
}
location ~* \.php$ {
try_files $uri =404;
keepalive_timeout 0;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_pass 127.0.0.1:9000;
}
}
瀏覽到/運行正常,並顯示在/ var/WWW /根的網站,但如果地方工作,我認爲他們應該在瀏覽/ WP應該帶我去的WordPress安裝在/ var/www/wordpress中。所有我得到的是:
404未找到
的nginx/0.7.67
如果我重新定位在/ var/WWW/WordPress的目錄到/ var/WWW /根/ WordPress的並瀏覽到/ wordpress都是完美的。
我在做錯位置塊?
我從來沒有配置過nginx,而且完全是一個完整的web newb。
我希望能夠爲其他應用程序提供更多位置塊。這真的只是這裏張貼的一個基本範例。
已將nginx更新到Debian Squeeze backports中的版本。無改善:
404未找到
的nginx/1.1.19
你試過去/ wp /而不是? –
你不想去想如何過時nginx/0.7.67是。 – Dayo
我試過/ wp /以及。這是來自Debian 6存儲庫的nginx。我猜Debian確實傾向於稍微落後一點。儘管我傾向於堅持回購協議中的內容。 – goji