Francis Daly francis at
Wed Apr 6 00:16:51 MSD 2011

On Tue, Apr 05, 2011 at 03:01:21PM -0400, kalinski wrote:

Hi there,

it seems to work fine for me. Perhaps there is something extra in your

When I use two blocks:

  include fastcgi.conf;
  location ~ ^/a/.*php$ {
    root /tmp;
    fastcgi_pass  unix:php.sock;
  location ~ .php$ {
    fastcgi_pass  unix:php.sock;

then getting /t/env.php shows the output of the file
/usr/local/nginx/html/t/env.php; while getting /a/env.php shows the
output of the file /tmp/a/env.php.

Exactly as I'd expect.

> I used this regex:
> location ~ ^/phpmyadmin/(.*)(\.php)$
> to catch it but it won't work like expected...

As above, it works for me.

For each request, exactly one location is used. What does "grep location
nginx.conf" show? It will hopefully show the various location blocks you
define, in order.

That, plus the http request you make, should let you determine which
location block is being used. (Or you could just look in the debug log.)

If it's not what you want, then you can configure things differently.

Good luck with it,

Francis Daly        francis at

More information about the nginx mailing list