Welcome! Log In Create A New Profile

Advanced

Name of upstream is returned to a client and not resolved to a server

Tobias Hipp
September 18, 2012 05:30AM
Hello everybody,

I'd like to setup nginx as a softwareloadbalancer, balancing incoming
requests to different tomcats.

In order to achiev my goal, i defined some upstreams like this:

upstream myupstream {
server 192.168.x.y:8080 weight=1 max_fails=10 fail_timeout=60s;
server 192.168.x.z:8080 weight=1 max_fails=10 fail_timeout=60s;
}

Surfing to mysubdomain.mysite.com is handled by this location block in a
serverblock with the servername mysubdomain.mysite.com:

location = / {
proxy_set_header X-Forwarded-Host $host;
proxy_set_header X-Forwarded-Server $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_pass
http://myupstream/home/index?layoutTheme=mysubdomain_theme;
}

This still works fine. But when i click a link on that webpage, leading
to the startpage of the website (the link is something like
http://mysubdomain.mysite.com/home/index?layoutTheme=mysubdomain_theme)
I get an error message.
The request, produced by that link should be handled by this location
block in the same server block:
location / {
proxy_set_header X-Forwarded-Host $host;
proxy_set_header X-Forwarded-Server $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_pass http://myupstream;
}
A Chromium based browser shows "Error 105 (net::ERR_NAME_NOT_RESOLVED):"
and Firefox tells me, that the server www.myupstream.com could not be
found.
Can anyone help me locate the mistake I made in my configuration?
I'm using Ubuntu server 12.04.1 and nginx 1.2.3 out of the nginx repository.

Have a nice Day
T.Hipp

_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
Subject Author Posted

Name of upstream is returned to a client and not resolved to a server

Tobias Hipp September 18, 2012 05:30AM

Re: Name of upstream is returned to a client and not resolved to a server

Francis Daly September 18, 2012 04:12PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 177
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