404 location problem

this configure
can’t visit www.abc.com/blog/index.php error 404
but can visit www.abc.com/blog/info.txt
I don’t know how to do?
please tell me! thanks.

server {
listen 80;
server_name www.abc.com;
root /data0/www/abc;
index index.htm index.html index.php;

location /blog/ {
root /data0/www;
}
#php fastcgi
location ~ .*\.php?$ {
    fastcgi_pass   127.0.0.1:9000;
    fastcgi_index  index.php;
    #fastcgi_param  SCRIPT_FILENAME 

$document_root$fastcgi_script_name;
include fastcgi.conf;
}

access_log  /var/log/nginx/access.log  main;

}

Posted at Nginx Forum:

Hello!

On Wed, Jan 13, 2010 at 09:31:34PM -0500, lnxa wrote:

root /data0/www/abc;
  1. server root is /data0/www/abc.
index index.htm index.html index.php;

location /blog/ {
root /data0/www;
  1. location /blog/ has root redefined into /data0/www, so
    “/blog/info.txt” will be searched in file “/data0/www/blog/info.txt”.
}
#php fastcgi
location ~ .*\.php?$ {

Just a side note: did you mean “~ .php$”? Prefix “.*”
meaningless as it matches everything, and “?” looks strange since
you probably don’t want “.ph” files to be passed to php.

    fastcgi_pass   127.0.0.1:9000;
    fastcgi_index  index.php;
    #fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;
    include        fastcgi.conf;
  1. location ~ .php$ has no root explicitly defined, and therefore
    uses one inherited from server, i.e. “/data0/www/abc”. So
    “/blog/index.php” will be mapped into
    “/data0/www/abc/blog/index.php”.

Note: resulting file names in 2 and 3 are very different. If you
want them to be in the same directory - you probably want to
define identical roots for both locations (i.e. define correct
one in server and don’t redefine in locations).

}
    

access_log  /var/log/nginx/access.log  main;

}

Maxim D.

fastcgi.conf

fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param QUERY_STRING $query_string;
fastcgi_param REQUEST_METHOD $request_method;
fastcgi_param CONTENT_TYPE $content_type;
fastcgi_param CONTENT_LENGTH $content_length;

fastcgi_param SCRIPT_NAME $fastcgi_script_name;
fastcgi_param REQUEST_URI $request_uri;
fastcgi_param DOCUMENT_URI $document_uri;
fastcgi_param DOCUMENT_ROOT $document_root;
fastcgi_param SERVER_PROTOCOL $server_protocol;

fastcgi_param GATEWAY_INTERFACE CGI/1.1;
fastcgi_param SERVER_SOFTWARE nginx;

fastcgi_param REMOTE_ADDR $remote_addr;
fastcgi_param REMOTE_PORT $remote_port;
fastcgi_param SERVER_ADDR $server_addr;
fastcgi_param SERVER_PORT $server_port;
fastcgi_param SERVER_NAME $server_name;

PHP only, required if PHP was built with --enable-force-cgi-redirect

fastcgi_param REDIRECT_STATUS 200;

english not well
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
problem in here ?

my english is not well.
can you tell me how to configure,thanks.

Posted at Nginx Forum:

Hello!

On Wed, Jan 13, 2010 at 10:41:33PM -0500, lnxa wrote:

location /blog/ {

}

http://www.abc.com/blog/index.php error 403

in this case must copy /data0/www/blog to /data0/www/abc? not other idea?

server {
listen 80;
server_name www.abc.com;
root /data0/www/abc;
index index.htm index.html index.php;
location / {
# everything inherited here
}
location /blog/ {
root /data0/www;
}
location ~ ^/blog/.*.php$ {
root /data0/www;
fastcgi_pass 127.0.0.1:9000;
include fastcgi.conf;
}
location ~ .php$ {
fastcgi_pass 127.0.0.1:9000;
include fastcgi.conf;
}
}

Maxim D.

uh,
fastcgi problem on $document_root$fastcgi_script_name;
one root for abc ,one root for blog
Maxim D.,thanks for your help.

Posted at Nginx Forum:

server {
listen 80;
server_name www.abc.com;
#root /data0/www/abc;
#index index.htm index.html index.php;
location / {
root /data0/www/abc;
index index.htm index.html index.php;
}
location /blog/ {
alias /data0/www/blog/;
}
#php fastcgi
location ~ .php$ {
root /data0/www/abc;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
#fastcgi_param SCRIPT_FILENAME
$document_root$fastcgi_script_name;
include fastcgi.conf;
}

}

http://www.abc.com/blog/index.php error 403

in this case must copy /data0/www/blog to /data0/www/abc? not other
idea?

Posted at Nginx Forum: