Welcome! Log In Create A New Profile

Advanced

Re: Set up reverse proxy and loadbalancing without hostname

Francis Daly
July 09, 2016 12:28PM
On Sat, Jul 09, 2016 at 11:23:41AM -0400, bai030805 wrote:

Hi there,

> Nginx IP: 192.168.16.206
> Four Web Server: 192.168.16.201-204

Is there one Host: header that you can send in requests to each of the
four web servers, so that they will all return the content that you want?

If so, use that. If not, send none. That is...

> location / {
> proxy_pass http://myapp1;

nginx will make a request of the upstream server including "Host: myapp1".

You can change that by using "proxy_set_header Host" with your preferred
name. (Or you can use that name instead of "myapp1" here, and in the
"upstream" definition.)

Possibly

proxy_set_header Host "";

is what you want here.

Depending on what your upstream servers send, you may need more config
in nginx to get everything to work the way that you want it to.

> }

> }
>
> from web brower, i use http://192.168.16.206 to access the web server. the
> web brower redirect "http://192.168.16.206" to "https://myapp1/"

If there really is a switch from http to https, that suggests that
something extra is happening.

What response do you get from

curl -v -H Host:myapp1 http://192.168.16.201/

? Because that is more-or-less the request than nginx makes.

Good luck with it,

f
--
Francis Daly francis@daoine.org

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

Set up reverse proxy and loadbalancing without hostname

bai030805 July 09, 2016 11:23AM

Re: Set up reverse proxy and loadbalancing without hostname

dewanggaba July 09, 2016 11:30AM

Re: Set up reverse proxy and loadbalancing without hostname

Francis Daly July 09, 2016 12:28PM

Re: Set up reverse proxy and loadbalancing without hostname

Pratyush Kumar July 09, 2016 01:54PM

Re: Set up reverse proxy and loadbalancing without hostname

bai030805 July 10, 2016 10:41AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

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