Welcome! Log In Create A New Profile

Advanced

Nginx Location Block

Julian De Marchi
May 25, 2015 01:46AM
heya-

I'm having some interesting dramas with Nginx location block. I put it
down to a misconfiguration in my conf files, but I can't locate what it
possible could be.

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:

location / {
limit_req zone=root burst=300;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header HTTPS on;
proxy_set_header X-Forwarded-HTTPS on;
proxy_set_header X-Forwarded-Protocol $scheme;
proxy_pass http://webpool;
}

Here is my log entry for accessing the URI.

"25/May/2015:14:33:01 +1000" "example.com" -275 428 "GET /cms/index.php
HTTP/1.1" "404" "-" "10.107.0.8" "Mozilla/5.0 (X11; Linux x86_64;
rv:31.0) Gecko/20100101 Firefox/31.0 Iceweasel/31.6.0"

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?

I've read and re-read the below and I'm drawing blanks, as my
understanding is, it should work.
-
https://www.digitalocean.com/community/tutorials/understanding-nginx-server-and-location-block-selection-algorithms

- http://nginx.org/en/docs/http/ngx_http_core_module.html#location

Many thanks in advance for helping me understand my problem.

--julian

_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
Subject Author Posted

Nginx Location Block

Julian De Marchi May 25, 2015 01:46AM

Re: Nginx Location Block

Aleksandar Lazic May 25, 2015 03:06AM

Re: Nginx Location Block

Julian De Marchi May 25, 2015 04:12AM

Re: Nginx Location Block

Francis Daly May 26, 2015 07:48PM

Re: Nginx Location Block

Julian De Marchi May 26, 2015 08:00PM

Re: Nginx Location Block

Francis Daly May 26, 2015 08:16PM

Re: Nginx Location Block

Julian De Marchi May 26, 2015 08:44PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 192
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready