Welcome! Log In Create A New Profile

Advanced

Re: upstream host name or address

June 20, 2011 12:57AM
hi again and thank you fo reply
this is my main config file; sorry i remove real ip address and site names

upstream mysites {
server 192.168.1.1 weight=5;
# server 192.168.1.2 weight=3;
}
upstream mysites_hash {
ip_hash; #base on clinet ip address and can not use weight;
server 192.168.1.1;
# server 192.168.1.2;
}
upstream myimages {
server images.mysite.com;
}
server {
listen 80;
server_name nx.chare.ir;
set $tmp tempstr;
access_log var/log/nx_csupdate_access.log main;
log_format main "$upstream_addr";

location / {
deny all;
}
location /csupdate/images {
proxy_pass http://myimages;
}
location /csupdate {
proxy_pass http://mysites_hash;
proxy_set_header Host 192.168.1.1;
}


as you can see i commented my 2th server in my upstream;
the proxy_set_header line in location /csupdate was the only soloution that solved
my problem; because my servers (192.168.1.1, 2) will redirect users base on some condition
and without proxy_set_header line the browsers fall in endless loop and retun errors;

for $upstream_addr in can see 192.168.1.1:80 in my log files as i formated simply likme above;
but what is soloution in i want to use 192.168.1.2 server too ??

thank you in advance
Subject Author Posted

upstream host name or address

torajx June 19, 2011 07:26AM

Re: upstream host name or address

torajx June 19, 2011 07:43AM

Re: upstream host name or address

Maxim Dounin June 19, 2011 05:42PM

Re: upstream host name or address

torajx June 20, 2011 12:57AM

Re: upstream host name or address

torajx June 20, 2011 12:59AM

Re: upstream host name or address

torajx June 20, 2011 02:23AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 317
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready