Nginx Location Block

Francis Daly francis at
Wed May 27 00:15:08 UTC 2015

On Wed, May 27, 2015 at 09:58:42AM +1000, Julian De Marchi wrote:
> On 27/05/15 09:45, Francis Daly wrote:
> > On Mon, May 25, 2015 at 03:44:26PM +1000, Julian De Marchi wrote:

Hi there,

> >> My issue is when I try to access URIs like /cms/index.php?blah, the
> >> frontend Nginx gives 404. Access with /cms/ and Nginx passes the request
> >> to the backend.

> > Is this the only location{} block in the only server{} block in your
> > frontend nginx.conf file? Are there any "include" directives that
> > might add others? Are there any rewrite-module directives outside this
> > location{}?
> For this virtual host, yes it is. My rewriting logic is performed in the
> backend. There are no include directives.

I am unable to reproduce what you report.

The configuration you have shown, plus some assumed configuration that
you have not shown, should not do what you report it does do.

Can you try using a separate access_log in this frontend server{} block,
and confirming that the request is handled by this server{} and not by
any other one?

> > How do you know that it does not pass it to the backend?

> I'm watching the backend access log for the virtual host and never see
> it come in. When a requests reaches the backend I also insert headers so
> I can tell which backend server handled the request.

Does the backend configuration include anything that would log to a
different access log, or not log at all?

Or can you (temporarily, or on a test system) replace the backend with
one that just does "return 200 here", and confirm that you do not get
that response when you make the second request?

Is there any form of caching going on? Are you testing using "curl"
or a bigger browser?

Francis Daly        francis at

More information about the nginx mailing list