root and alias with php5-fpm

Kristofer Pettijohn kristofer at
Mon Sep 7 23:48:57 UTC 2015

Thanks for the response.

> I suggest using a named location for handling the "not there" fallback
> -- either as the final argument to try_files, or perhaps as "error_page
> 404 = @fallback".
> Then
>  location @fallback {
>    fastcgi_param SCRIPT_FILENAME /apps/grant/index.php;
>    include fastcgi_params;
>    fastcgi_pass unix:/local/sockets/grant.sock;
>  }

That is what I am attempting to do with my try_files directive:

try_files $uri $uri/ /grant/index.php?$args;

If the file does not exist, I want it to try “index.php” in the root of the grant folder, so in the try_files directive I have “/grant/index.php?$args” so that it tries using the proper location.  At least that’s how I understand try_files?

More information about the nginx mailing list