Nginx Location Block

Julian De Marchi juliand at
Tue May 26 23:58:42 UTC 2015

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,
>> Briefly, my setup is using an Nginx frontend server to do SSL offloading
>> then pass requests to my backend Nginx servers which then process the
>> request via fastCGI.
>> 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.
>> Here is my frontend location block:
> 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.

>> What I don't understand is this, why does Ngnix pass the URI /cms/ to my
>> backend fine, but add /cms/index.php to the end and it does not pass to
>> the backend?
> How do you know that it does not pass it to the backend?
> Do you watch a tcpdump trace, or do you watch the backend access log,
> or something like that?

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.


More information about the nginx mailing list