Welcome! Log In Create A New Profile

Advanced

Re: NGINX only for forwarding to LAN

Francis Daly
December 12, 2019 11:38AM
On Thu, Dec 12, 2019 at 11:22:10AM -0500, pixel24 wrote:

Hi there,

> in the webbrowser firefox show me the status:
>
> connect to: http://192.168.XX.5
>
> that can't work, can it? This address is not available in inetrnet

Quoting my previous message:

"""
If you can report a specific problem -- such as "when I do 'curl -i
http://gw.mydomain.com/dir', I get a 301 to http://192.168.xx.5/dir/
but I want a 301 to http://gw.mydomain.com/dir/", then someone may be
able to offer an improvement.
"""

Can you show the very specific request that you make, response that you
get, and response that you want instead?

Does your web service on http://192.168.XX.5 "just" serve files from
the filesystem, or does it try to do clever things with hostnames?

Depending on what else is happening, perhaps something like (again,
typed and untested):

upstream gw.mydomain.com {
server 192.168.XX.5;
}
upstream cloud.mydomain.com {
server 192.168.XX.6;
}
server {
server_name gw.mydomain.com;
location / {
proxy_pass http://gw.mydomain.com;
}
}
server {
server_name cloud.mydomain.com;
location / {
proxy_pass http://cloud.mydomain.com;
}
}

will get closer to what you want.

That is - using the hostname in proxy_pass means that the matching Host:
header will be sent to the upstream server; so if that server uses the
incoming name in a redirection, perhaps the right url will get back to
the client.

I think that it should not be necessary, because nginx's proxy_redirect
should have already handled it. But apparently it did not, in this case.

Cheers,

f
--
Francis Daly francis@daoine.org
_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
Subject Author Posted

NGINX only for forwarding to LAN

pixel24 December 11, 2019 07:42AM

Re: NGINX only for forwarding to LAN

Francis Daly December 11, 2019 03:22PM

Re: NGINX only for forwarding to LAN

pixel24 December 12, 2019 11:02AM

Re: NGINX only for forwarding to LAN

pixel24 December 12, 2019 11:22AM

Re: NGINX only for forwarding to LAN

Francis Daly December 12, 2019 11:38AM

Re: NGINX only for forwarding to LAN

pixel24 December 12, 2019 01:12PM

Re: NGINX only for forwarding to LAN

pixel24 December 13, 2019 02:39AM

Re: NGINX only for forwarding to LAN

Francis Daly December 13, 2019 08:24AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

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