Having a hard time trying to figure out location blocks in the nginx config. This is what I have:
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;
}
}
Browsing to / works as expected and shows the website in /var/www/root, but if locations work as I think they should browsing to /wp should take me to the wordpress installation in /var/www/wordpress. All I am getting is:
404 Not Found
nginx/0.7.67
If I relocate the /var/www/wordpress directory to /var/www/root/wordpress and browse to /wordpress all is perfect.
What am I doing wrong with the location block??
I've never configured nginx before and am a bit of a complete web newb anyway.
I want to be able to have more location blocks for other applications as well. This is really just a basic example for posting on here.
Updated nginx to version in Debian Squeeze backports. No improvement:
404 Not Found
nginx/1.1.19