Welcome! Log In Create A New Profile

Advanced

A topology when nginx is in reverse-proxy mode? support ?

February 05, 2012 12:04AM
hi all:

please see the following topology in my test-bed, it always accesses the
first website in reverse-proxy.

1. Topology

Outside -------------------[ NAT Device] -----------------[nginx with
reverse-proxy]----------------Web1 (1.1.1.1:80)
[http://2.2.2.2:8000 |
| |______Web2 (1.1.1.2:80)
[http://2.2.2.2:8001 2.2.2.2
1.1.1.255

2. How to access

(1) Access http://2.2.2.2:8000 from outside to access web1;
Access http://2.2.2.2:8001 from outside to access web2;
(2) NAT device translated 2.2.2.2 to different internal IP address
according to port;
http://2.2.2.2:8000 =====NAT===> http://1.1.1.1(web1);
http://2.2.2.2:8001 =====NAT===> http://1.1.1.2(web2);
(3) NGINX act as reverse proxy;

3. issue
We configure nginx as reverse proxy, but it always proxy
(http://1.1.1.1and http:/
1.1.1.2) to http://1.1.1.1;

nginx configure is as following

server {
listen 80;
server_name 2.2.2.2; // (try 2.2.2.2:8000, it failed)

location / {
proxy_pass http://1.1.1.1; # <==========Web1
....
}
}

server {
listen 80;
server_name 2.2.2.2; # (try 2.2.2.2:8000, it failed)

location / {
proxy_pass http: #1.1.1.2; # <==========Web2
....
}
}

4. I try to change the configuration, it is failed.

My configuration is good ? Is the topology supported?

thanks

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

A topology when nginx is in reverse-proxy mode? support ?

nexthop February 05, 2012 12:04AM

Re: A topology when nginx is in reverse-proxy mode? support ?

Maxim Dounin February 05, 2012 06:08AM

Re: A topology when nginx is in reverse-proxy mode? support ?

Francis Daly February 05, 2012 06:18AM

Re: A topology when nginx is in reverse-proxy mode? support ?

nexthop February 05, 2012 11:54AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

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