hi all:<br><br>please see the following topology in my test-bed, it always accesses the first website in reverse-proxy. <br><br>1. Topology<br><br> Outside -------------------[ NAT Device] -----------------[nginx with reverse-proxy]----------------Web1 (<a href="http://1.1.1.1:80">1.1.1.1:80</a>)<br>
[<a href="http://2.2.2.2:8000">http://2.2.2.2:8000</a> | | |______Web2 (<a href="http://1.1.1.2:80">1.1.1.2:80</a>)<br> [<a href="http://2.2.2.2:8001">http://2.2.2.2:8001</a> 2.2.2.2 1.1.1.255<br>
<br> 2. How to access <br><br> (1) Access <a href="http://2.2.2.2:8000">http://2.2.2.2:8000</a> from outside to access web1; <br> Access <a href="http://2.2.2.2:8001">http://2.2.2.2:8001</a> from outside to access web2; <br>
(2) NAT device translated 2.2.2.2 to different internal IP address according to port; <br> <a href="http://2.2.2.2:8000">http://2.2.2.2:8000</a> =====NAT===> <a href="http://1.1.1.1">http://1.1.1.1</a>(web1);<br>
<a href="http://2.2.2.2:8001">http://2.2.2.2:8001</a> =====NAT===> <a href="http://1.1.1.2">http://1.1.1.2</a>(web2);<br> (3) NGINX act as reverse proxy; <br><br>3. issue<br> We configure nginx as reverse proxy, but it always proxy (<a href="http://1.1.1.1">http://1.1.1.1</a> and http:/<a href="http://1.1.1.2">1.1.1.2</a>) to <a href="http://1.1.1.1">http://1.1.1.1</a>;<br>
<br> nginx configure is as following<br> <br> server {<br> listen 80;<br> server_name 2.2.2.2; // (try <a href="http://2.2.2.2:8000">2.2.2.2:8000</a>, it failed)<br> <br> location / {<br>
proxy_pass <a href="http://1.1.1.1">http://1.1.1.1</a>; # <==========Web1<br> ....<br> }<br> }<br> <br> server {<br>
listen 80;<br>
server_name 2.2.2.2; # (try <a href="http://2.2.2.2:8000">2.2.2.2:8000</a>, it failed)<br>
<br>
location / {<br>
proxy_pass http: #1.1.1.2; # <==========Web2<br>
....<br>
}<br>
}<br><br>4. I try to change the configuration, it is failed. <br><br> My configuration is good ? Is the topology supported? <br><br>thanks <br><br>George. Alex. <br>