hi all:
please see the following topology in my test-bed, it always accesses the
first website in reverse-proxy.
-
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 -
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; -
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 .... }
}
-
I try to change the configuration, it is failed.
My configuration is good ? Is the topology supported?
thanks
George. Alex.