在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