2 Replies Latest reply: Nov 24, 2009 11:06 AM by 807573 RSS

    Sun Web server 7  - Reverse proxy to different

    807573
      Hi All,
      I have following scenario:
      I have deploy my application into 2 dedicated weblogic servers, http://host1:7001/myapp and http://host2:7001/myapp. How can I configure the reverse proxy so whenever user enter the URL, webserver will forward different app server like below;
      #1 - http://abc.com >> web server will forward to http://host1:7001/myapp
      #2 - http://abc.com/controller>> web server will forward to http://host2:7001/myapp

      I follow tutorial from this link >> http://blogs.sun.com/amit/entry/setting_up_a_reverse_proxy
      For requirement #1 it work perfectly since i put URI = /myapp and Server URL = http://host1:7001.
      But for #2, it doesnt work since I put the URI=/controller.
      We wanted to be like http://abc.com/controller, so it will forward to second app server which difference application.
      Is it possible? or any other to do like that?
      Thanks!
        • 1. Re: Sun Web server 7  - Reverse proxy to different
          807573
          you will need to edit the obj.conf or <hostname>-obj.conf and move the ordering so that it looks some thing like

          NameTrans fn="map" from="/controller"
          NameTrans fn="map" from="/"

          and try to either restart or reconfig (to load the changes without requiring a restart) and see if this is what you want. if yes, then you will need to run admin's pull-config cli command to bring your manual changes into admin repo.

          <install-root>/bin/wadm pull-config user=admin config=<hostname.domainname> <hostname>.<domainname>
          • 2. Re: Sun Web server 7  - Reverse proxy to different
            807573
            Hi Sriram,

            I'm having similar problem with atehac, the only difference is that the web server
            #1 http://domain.com/web1 >> forwarded to http://local-pc1.com:8080/
            #2 http://domain.com/web2 >> forwarded to http://local-pc2.com:8080/

            This is the setting that I've made in <vs>obj.conf :

            NameTrans fn="map" from="/web1" name="reverse-proxy-/web1" to="http:/"
            NameTrans fn="map" from="/" name="reverse-proxy-/web1" to="http:/"
            NameTrans fn="map" from="/web2" name="reverse-proxy-/web2" to="http:/"
            NameTrans fn="map" from="/" name="reverse-proxy-/web2" to="http:/"

            <Object name="reverse-proxy-/web1">
            Route fn="set-origin-server" server="http://local-pc1.com:8080"
            </Object>

            <Object name="reverse-proxy-/web2">
            Route fn="set-origin-server" server="http://local-pc2.com:8080"
            </Object>

            But the problem is local-pc2 won't be able to be accessed, while for local-pc1 will be mapped, but it omit /web1
            So it will be like http://domain.com/web1 at the beginning, but after I press enter it became like http://domain.com
            What I wish is something like http://domain.com/web1 all the way.

            Do you have any idea Sriram?

            Regards,


            Berry