Nginx 1.7.0: location @php

TECK nginx-forum at
Thu Jun 5 03:41:56 UTC 2014

Jonathan Matthews Wrote:
> Fortunately, this being a *public* *mailing* *list*, and Francis
> (along with almost every other subscriber) giving his time, experience
> and opinions for free, you are definitely no worse off than when you
> started.
> Actually, however, you're demonstrably better off, as Francis has both
> attempted to help you go through the kind of troubleshooting process
> that will serve you well if you apply it (Message-ID
> 20140525132809.GN16942 at and ...
> > I think what I asked is
> > very clear and simple:
> > How do I avoid repeating a segment of configuration code assigned to
> @php
> > into various locations:
> .... he has given you the answer to this question - that you clearly
> thought you began by asking, but didn't. In Message-ID
> 20140531112745.GZ16942 at
> HTH.

I'm sorry, I did not understood nothing. Can you provide an example of how
to avoid repeating the php configuration through @php location?
IMO the logic presented is clear: define a @php location and call it in
other locations with try_files, like explained into Nginx documentation. In
my case the end result is unexpected, the php file contents will be
downloaded, instead of being executed. This works:

This does not:

Posted at Nginx Forum:,250342,250655#msg-250655

More information about the nginx mailing list