root and alias with php5-fpm

Francis Daly francis at
Mon Sep 7 21:23:53 UTC 2015

On Mon, Sep 07, 2015 at 11:23:32AM -0500, Kristofer Pettijohn wrote:

Hi there,

> I just want each location in each
> server to see /apps/grant/ as the root, and for try_files to process
> the index.php file in the base of that location last.

If I've understood you correctly, what you describe is not what your
current configuration does.

Assume that files called "yes" do exist on your filesystem, and files
called "no" do not exist.

What response do you want for requests for each of:


And do you get that response in each case? If not, does the difference
> Can someone provide some guidance? 

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".


  location @fallback {
    fastcgi_param SCRIPT_FILENAME /apps/grant/index.php;
    include fastcgi_params;
    fastcgi_pass unix:/local/sockets/grant.sock;

Test what order of the first two directives work in your fasctcgi server.

Francis Daly        francis at

More information about the nginx mailing list