a reverse proxy issue

skk nginx-forum at nginx.us
Tue Nov 23 10:13:47 MSK 2010


I have an enviroment as follows:

       PC(192.168.95.2) ------ReverseProxy(Run Nginx,192.168.95.1
and 192.168.1.1)---------------OA Server(192.168.1.100)
                                                                        
                                                 ---------------Mail
Server(192.168.1.200)

      PC want to access oa server1 and mail server through reverse
proxy,My config is :

    upstream OA {
        server  192.168.1.100;
    }
    upstream  MAIL {
        server  192.168.1.200;
    }
  server {
        listen       80;
        server_name  192.168.95.1;

        location  /oa/ {
               proxy_pass  http://OA/;
               proxy_set_header Host $host/oa;
               proxy_set_header X-Forwarded-For $remote_addr;
          }
       location  /mail/ {
            proxy_pass  http://MAIL/;
            proxy_set_header Host $host/mail;
           proxy_set_header X-Forwarded-For $remote_addr;
        }
        
   PC access OA server by http://192.168.95.1/oa/, access Mail server by
http://192.168.95.1/mail/.
   But content return from OA server  include some URL:
   1)  /abc/xxxx/....
        These urls will be http://192.168.95.1/abc/xxxx/.... in
PC,They can't be proxy.
   2) http://192.168.1.100/efg/xxxx/...
       These urls will be http://192.168.1.100/efg/xxxx/... in PC, but
PC can't access 192.168.1.100 directly.
    3)  http://192.168.1.200/ghi/xxxx/....
         These urls will be http:// 192.168.1.200/ghi/xxxx/.... in PC,
but PC can't access 192.168.1.200 directly.
    4) https://192.168.1.100/opq/xxxxxx/....
    5) https://192.168.1.200/rst/xxxxxx/....
    
    All above urls can't be access by PC, How to config my Nginx?
    
    Thanks.

Posted at Nginx Forum: http://forum.nginx.org/read.php?2,152568,152568#msg-152568




More information about the nginx mailing list