3 messages in ru.sysoev.nginxRe: configuration for proxy_pass/upst...
FromSent OnAttachments
Mathew DaviesJun 4, 2009 4:11 pm 
Mohammad KolahdouzanJul 14, 2009 5:01 pm 
Maxim DouninJul 14, 2009 6:54 pm 
Actions with this message:
Paste this link in email or IM:
Paste this link in email or IM:
Atom feed for this thread
Paste this URL into your reader:
Subject:Re: configuration for proxy_pass/upstream combinationActions...
From:Maxim Dounin (mdou@mdounin.ru)
Date:Jul 14, 2009 6:54:40 pm
List:ru.sysoev.nginx

Hello!

On Tue, Jul 14, 2009 at 05:01:31PM -0700, Mohammad Kolahdouzan wrote:

I have my own module in which when a request is sent to /mymodule, it'll initiate a new subrequest to "/a1" and passes a bunch of new arguments to it. As an example, a call to "http://localhost/mymodule" will generate a subrequest like "http://a.com/?x=1&y=2" I have a config similar to the following to support that :

server { location /mymodule { my_module; } location /a1 { proxy_pass http://a.com/; } }

Now the issue that I have is when I want to add redundancy. If I change the
config file to something similar to the following:

upstream server1{ server http://a.com; server http://b.com; } server { location /mymodule { my_module; } location /a1 { proxy_pass http://server1;

- proxy_pass http://server1; + proxy_pass http://server1/;

See http://wiki.nginx.org/NginxHttpProxyModule#proxy_pass for details.

} }

then a request to "http://localhost/mymodule" will generate a subrequest like
"http://a.com/a1/?x=1&y=1". I am wondering what it is that I am doing wrong
which adds "/a1/" to the subrequest to upstream.

Thanks, -M