Welcome! Log In Create A New Profile

Advanced

Re: Reverse proxy for multiple websites

Maxim Dounin
January 02, 2012 07:00PM
Hello!

On Mon, Jan 02, 2012 at 12:10:59PM +0700, Nguyen Hai Nam wrote:

> Hi,
>
> I'm sticking on configure a reverse proxy, my scenario looks like:
>
> Internet
> .......|
> .......|__Reverse proxy (listen port 80)
> ......................|__web1.com (listen port 8080)
> ......................|__web2.net (listen port 8080)
> ......................|__web-n.org (listen port 8080)
>
> Assume All website shared one public IP only and each website runs on
> independent VPS.
>
> If I create multi server{} block to use proxy_pass directive to web
> server inside, it's only web1.com can be reachable (perhaps it's on
> top config).
>
> It's highly appreciate if someone advice me ideas to make this working.

If many backend sites share the same ip, and you refer all of them
with the same name (or ip) in proxy_pass directive, you probably
want to use somethine like

proxy_set_header Host <name>;

to make sure backend will be able to distinguish them. Or just

proxy_set_header Host $host;

to pass what you've got from client.

Maxim Dounin

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

Reverse proxy for multiple websites

Nguyen Hai Nam January 02, 2012 12:12AM

Re: Reverse proxy for multiple websites

Maxim Dounin January 02, 2012 07:00PM

Re: Reverse proxy for multiple websites

dev January 16, 2012 01:14AM

Re: Reverse proxy for multiple websites

Neddy January 18, 2012 08:43PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

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