Problem with fastcgi_split_path_info on ubuntu precise

Francis Daly francis at
Tue May 14 21:37:52 UTC 2013

On Tue, May 14, 2013 at 10:17:13AM -0400, vilsack wrote:
> Francis Daly Wrote:
> > On Sun, May 05, 2013 at 07:04:21AM -0400, zakaria wrote:

Hi there,

> > >         location ~ [^/]\.php(/|$) {
> > 
> > Just as another alternative, it is probably possible to use named captures
> > in the "location" regex and avoid using fastcgi_split_path_info at all
> > -- with everything up to and including ".php" being used as the script
> > name, and something like "(/.*)?$" being the path info.

> Francis, could you please show me an example?

  location ~ ^(?<script_name>.+\.php)(?<path_info>/.*)?$ {

is one possible way.

Then use $script_name and $path_info as you see fit.

> I'm encountering this issue on Ubuntu 12.04.2 LTS while trying to set up
> Phalcon; a c lib/framework for PHP.  So far the other fixes in this thread
> haven't worked.  

"this issue" is "everything works fine, until you use try_files in
the same location as fastcgi_split_path_info", unless I misunderstand
things. It should be easy enough to test -- just comment out the try_files
and see that your request gives the expected response.

> Phalcon's Doc:
> I think Phalcon is dependent on how fastcgi_split_info works, so I'm trying
> to "replicate" how it handles the rewrite using regex.  Am I going about
> this the wrong way?

That Phalcon doc seems to suggest four distinct and different ways
of configuring nginx, so that it works with four different ways of
configuring Phalcon.

None of them seem to use try_files in the same (useful) location as

What is the one way that you have configured Phalcon?

What is the matching one way that you have configured nginx?

What request do you make, what response do you get, and what response
do you expect?

If your testing suggests that this is a different issue, it's probably
worth creating a new thread for further responses.


Francis Daly        francis at

More information about the nginx mailing list