Rewrite URI and pass request to the upstream server
mike
mike503 at gmail.com
Tue Mar 17 20:19:58 MSK 2009
On Tue, Mar 17, 2009 at 10:09 AM, Ruben. D. <ruben.grunge84 at gmail.com> 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.
This is a wild shot but you might try
- proxy_pass http://mongrel;
+ proxy_pass http://mongrel/;
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
proxy_pass http://127.0.0.1:3000/;
If you don't plan on adding anymore in the future...
More information about the nginx
mailing list