Welcome! Log In Create A New Profile

Advanced

upsteam + proxy_redirect ??

June 11, 2011 02:18PM
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;

---------------------------------------
upstream mysites {
server www.mysite1.com;
}

upstream myimages {
server image.mysite1.com;
}
location /v1 {
proxy_pass http://www.mysite1.com;
proxy_redirect http://www.mysite1.com/v1 http://www.mynginxserver.com/v1
}

location /v2 {
proxy_pass http://mysites/v2;
proxy_redirect http://www.mysite1.com http://www.mynginxserver.com/v2;
}

location /images {
proxy_pass http://www.mysite2.com/images;
}
Subject Author Posted

upsteam + proxy_redirect ??

torajx June 11, 2011 02:18PM

Re: upsteam + proxy_redirect ??

torajx June 14, 2011 03:24AM

Re: upsteam + proxy_redirect ??

Maxim Dounin June 14, 2011 04:24AM

Re: upsteam + proxy_redirect ??

torajx June 14, 2011 06:03AM

Re: upsteam + proxy_redirect ??

Maxim Dounin June 14, 2011 07:28AM

Re: upsteam + proxy_redirect ??

torajx June 14, 2011 10:25AM

Re: upsteam + proxy_redirect ??

torajx June 15, 2011 01:37AM

Re: upsteam + proxy_redirect ??

torajx June 15, 2011 03:19AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 69
Record Number of Users: 6 on February 13, 2018
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready