Issue with multiple location blocks to handle two webapps

Nikhil Bhardwaj goltus at gmail.com
Tue Aug 28 21:43:45 UTC 2012


Thanks Francis,

> >     location ^~ /*community*/ {
> >         try_files $uri $uri/ /index.php?qa-rewrite=$uri&$args;
>
> If you ask for /community/foo/bar, this will end up using
> /index.php?qa-rewrite=/community/foo/bar&, which will be handled in the
> top level "location ~ \.php" block.
>
> Perhaps you want
>
>   try_files $uri $uri/ /community/index.php?qa-rewrite=$uri&$args;
>
> here? (Not tested by me.)
> f
This did the trick. $uri had /community as the first part but you are
right using
 try_files $uri $uri/ /community/index.php?qa-rewrite=$uri&$args;
forced it to use the correct php location and then in the application
removing /community from the $uri (which translates to
$_GET['qa-rewrite']) worked perfectly for me.

Thanks again.
Nikhil



More information about the nginx mailing list