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

Geoge.Q quan.nexthop at gmail.com
Sun Feb 5 05:02:12 UTC 2012


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.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.nginx.org/pipermail/nginx/attachments/20120205/1c342cc3/attachment.html>


More information about the nginx mailing list