Hi,
here is part of nginx.conf ; in some condition mysite1.com redirect
users
to some of its url so i need to use proxy_redirect in my locations;
now i want to start using upstream to add load balancing to my site;
the location v1 is working fine with my main site but when i want to
change its setting to something like location v2 it does not work and
redirect browser to mysite1.com and users can see the real site behind
the mynginxserver.com
can i use proxy_redirect when i use upstream ??
users type myngixxserver.com in their browser;
images stores on mysite2.com;
i will add more server to my upstream when the problem solves;
sorry for my bad english
mystic and mysite2 ip addresses are invalid
if more info is needed plaza tel me
thank you in advance;
On Tue, Jun 14, 2011 at 06:03:52AM -0400, torajx wrote:
thank you, i will try; but what is different between v1 and v2 ;
i just use upstream in v2 and server in upstream is the same as v1
server;
The difference is upstream name: in v1 you use your domain (the
same as in proxy_redirect), while in v2 you use upstream{} block
name. Upstream name is used in Host header in request to upstream
by default[1], and this may (and likely will) cause your backend
to return different redirects.
BTW, proxy_redirect default will use upstream name as well, and
this should handle such situations transparently. See [2] for
details.