Welcome! Log In Create A New Profile

Advanced

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

Francis Daly
September 18, 2012 04:12PM
On Tue, Sep 18, 2012 at 11:29:18AM +0200, Tobias Hipp wrote:

Hi there,

> 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.

> 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.

That sounds like the links are referring to http://myupstream, and the
two browsers have different error reporting/correcting behaviours.

If you view the source returned from the original
http://mysubdomain.mysite.com/ request, you may see that there.

> Can anyone help me locate the mistake I made in my configuration?

I guess that the tomcats are building "full" links instead of relative
ones. Or else they are issuing http redirects, and are not using the
server name you want them to.

Possibly adding

proxy_set_header Host $host;

or any variation that uses the appropriate "mysubdomain.mysite.com"
into the two location{}s will cause the tomcats to build full links
using the public hostname.

If you look at the output of "curl -i" or each request, you might see
exactly what is going on.

f
--
Francis Daly francis@daoine.org

_______________________________________________
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: 156
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