Problems with fastcgi php migration

Ian M. Evans ianevans at
Thu Mar 13 00:23:52 MSK 2008

Still trying to work out why, in my last mail (after I fixed my 
cut'n'paste error), the path_info wasn't getting populated with the 
stuff after the / but instead the script.

Began trying to finally understand how regex works. So a question:

In your location:

if ($uri ~ ^(/[^/]+)(/.*)) {
set  $script_name  $uri;
set  $path_info    $1;

If I'm understanding the tutorial I'm reading, don't the $NUM variables 
get populated by the parantheses? So wouldn't the set $path_info come 
from $2 since you have two sets of ()?

I thought that might explain the findings from my last email:

URL: /testgalleries
the URL gave a 404 error

URL: /testgalleries/
PATH_INFO:/testgalleries with no trailing slash. Should be /

URL: /testgalleries/30/1/1
PATH_INFO: /testgalleries  Should be /30/1/1

However, changing it to $2 created 404's in each test case.

So I'm not sure why $path_info isn't getting the right info.

Many thanks.

More information about the nginx mailing list