Hi friends, I need rewrite and old URI and pass the request to the
upstream
server, here is my current config file: http://pastie.org/418871
If for example I have http://pe.domain.com/xx-xxx-689 I need redirect to http://cl.domain.com/xx-xxx-689 and let the upstream process the new
request, with my current config I’ve obtained the rewrite of the URI but
nginx return me a 404 error, therefore it is not transfering the request
to
the upstream server because the 404 error page are different between
nginx
and my application.
On Tue, Mar 17, 2009 at 10:09 AM, Ruben. D. [email protected]
wrote:
Hi friends, I need rewrite and old URI and pass the request to the upstream
server, here is my current config file: http://pastie.org/418871
If for example I have http://pe.domain.com/xx-xxx-689 I need redirect to http://cl.domain.com/xx-xxx-689 and let the upstream process the new
request, with my current config I’ve obtained the rewrite of the URI but
nginx return me a 404 error, therefore it is not transfering the request to
the upstream server because the 404 error page are different between nginx
and my application.
I’ve never used named upstream locations but the ending slash does
have a different effect when passing HTTP to a backend. I believe it
maintains the /uri/ request as is, instead of winding up being
/uri/uri duplicated (I think is the easiest way to explain it?)
Also if you only have one mongrels server you could probably just do
On Tue, Mar 17, 2009 at 12:09:29PM -0500, Ruben. D. wrote:
Hi friends, I need rewrite and old URI and pass the request to the upstream
server, here is my current config file: http://pastie.org/418871
If for example I have http://pe.domain.com/xx-xxx-689 I need redirect to http://cl.domain.com/xx-xxx-689 and let the upstream process the new
request, with my current config I’ve obtained the rewrite of the URI but
nginx return me a 404 error, therefore it is not transfering the request to
the upstream server because the 404 error page are different between nginx
and my application.
According to your config, [new] request to cl.domain.com/xx-xxx-689
will end up in “location ~* [a-zA-Z]+(-)+689$”, which has no proxy_pass
rules. You should either duplicate proxy_pass rules within this
location, or
(better, faster, more scalable) separate pe.* and cl.* servers:
I’ve never used named upstream locations but the ending slash does
have a different effect when passing HTTP to a backend. I believe it
maintains the /uri/ request as is, instead of winding up being
/uri/uri duplicated (I think is the easiest way to explain it?)
No.
Form of proxy_pass with uri component (proxy_pass http://mongrel/)
changes matched location prefix to this uri component. So, for