
Tuesday May 16, 2006
Configuring Reverse Proxy in Sun Java System Web Server 7.0
Configuring Reverse Proxy in Sun Java System Web Server 7.0
Sun Java System Web Server 7.0 is now available for FREE and can be downloaded from
http://www.sun.com/download/index.jsp?cat=Web%20%26%20Proxy%20Servers&tab=3&subcat=Web%20Servers
Introduction
A reverse proxy is a proxy that appears to be a web server (origin server) to clients but in reality forwards the requests it receives to one or more origin servers. Because a reverse proxy presents itself as an origin server, clients do not need to be configured to use a reverse proxy. By configuring a given reverse proxy to forward requests to multiple similarly configured origin servers, a reverse proxy can operate as an application level software load balancer. In a typical deployment one or more reverse proxies will be deployed between the browsers and the origin servers.
In this article I will descirbe how to configure reverse proxy in Sun Java System Web Server 7.0 via CLI.
Configuring reverse proxy in Sun Java System Web Server 7.0
Go to Sun Java System Web Server 7.0 installation directory.
Start Admin Server
./admin-server/bin/startserv
Start wadm.
/bin/wadm --user=admin
Please enter
admin-user-password>
Sun Java System Web Server 7
B12/02/2005 18:02
wadm>
Then run create-reverse-proxy CLI
where server can contain more than one comma separated URLs.
obj.conf should have entries that look like
#obj.conf
<Object name="default">
...
NameTrans fn="map" from="/" name="reverse-proxy-/" to="http:/"
...
</Object>
...
<Object name="reverse-proxy-/">
Route fn="set-origin-server" server="http://abc.sun.com:8080"
</Object>
<Object ppath="http:*">
Service fn="proxy-retrieve" method="*"
</Object> |
Other Advanced reverse proxy CLIs
- list-reverse-proxy-uris
- set-reverse-proxy-prop
- get-reverse-proxy-prop
- forward-reverse-proxy-header
- block-reverse-proxy-header
- list-reverse-proxy-headers
Related links :
Posted by meena
( May 16 2006, 11:15:12 PM IST )
Permalink
Trackback URL: http://blogs.sun.com/meena/entry/configuring_reverse_proxy_in_sun
Hi Meena,
I have following scenario:
I have deploy my application in 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;
http://abc.com >> web server will forward to http://host1:7001/myapp
http://abc.com/download >> web server will forward to http://host2:7001/myapp
I have difficulties to configure the "http://abc.com/download" where web server will forward to http://host2:7001/myapp, since reverse proxy required valid URI (which in this case is /myapp).
Hope you can help.
Thanks
Posted by ateh on September 09, 2009 at 02:41 PM IST #
I have one Web Server 7.0 instance with the following obj.conf :
<Object name="default">
...
<If $uri =~ "/xyz">
NameTrans fn="map" from="/" name="reverse-proxy-/xyz" to="/"
</If>
<ElseIf $uri =~ "/abc">
NameTrans fn="map" from="/" name="reverse-proxy-/abc" to="/"
</ElseIf>
...
</Object>
<Object ppath="*">
Service fn="proxy-retrieve" method="*"
</Object>
<Object name="reverse-proxy-/abc">
Route fn="set-origin-server" server="http://server1.sun.com:80"
</Object>
<Object name="reverse-proxy-/xyz">
Route fn="set-origin-server" server="http://server2.sun.com:80"
</Object> ...
When I send a request to URI :
/abc/test1.html : the request gets served from server1 from docs/abc/test1.html.
/xyz/test2.html : the request gets served from server2 from docs/xyz/test2.html
Where as when you change obj.conf to (note the change in "from" parameter in "map" SAF)
<Object name="default">
...
<If $uri =~ "/xyz">
NameTrans fn="map" from="/xyz" name="reverse-proxy-/xyz" to="/"
</If>
<ElseIf $uri =~ "/abc">
NameTrans fn="map" from="/abc" name="reverse-proxy-/abc" to="/"
</ElseIf>
...
</Object>
<Object ppath="*">
Service fn="proxy-retrieve" method="*"
</Object>
<Object name="reverse-proxy-/abc">
Route fn="set-origin-server" server="http://server1:80"
</Object>
<Object name="reverse-proxy-/xyz">
Route fn="set-origin-server" server="http://server2:80"
</Object> ...
In this case when I send a request to URI :
/abc/test1.html : the request gets served from server1 from docs/test1.html.
/xyz/test2.html : the request gets served from server2 from docs/test2.html.
Posted by meena on September 10, 2009 at 03:41 PM IST #