Reverse Proxy Redirection Problem
Hi all
recently I installed sun one app server 8.1 sp2 as back end server and sun one web server 6.1 sp5 as the front end.
I also installed the reverse proxy plugin (provided by sun) correctly. the infrastructure is something like this:
web = http://aaa.com/mypath
app = http://bbb.com/mypath
client => web => app server
so when client type http://aaa.com/mypath, it will eventually executed http://bbb.com/mypath, but in the client browser still maintain http://aaa.com/mypath
so far so good.
but when the client executed http://aaa.com/mypath/myredirect.html (where myredirect.html is javascript redirection to certain html in my app server), the web server will execute http://bbb.com/mypath/myredirect.html, which eventually the html will be redirected to http://bbb.com/mypath/myfinalresult.html.
the problem is now on the client browser the url becomes http://bbb.com/mypath/myfinalresult.html. all i want is the url to be pointing to web server, that is http://aaa.com/mypath/myfinalresult.html
how to solve this problem? is it possible to do reverse mapping with passthrough library? any help is greatly appreciated! Thx !!
Cheers,
kami
# 1
for forward mapping,
NameTrans fn="map" from="...aaa..." to="...bbb..."
for reverse mapping,
NameTrans fn="reverse-map" from="...bbb..." to="...aaa..." rewrite-location="true"
So when the webserver receives a 302 redirect from the remote server, the "location:"
header will be rewritten to the "...aaa..." and then sent to the client. so your browser
sees a 302 redirect with the location as "...aaa...".
Hope this is what you are looking for.
motor at 2007-7-6 15:07:39 >

# 2
Hi motor
i try to put into obj.conf:
....
AuthTrans fn="match-browser" browser="*MSIE*" ssl-unclean-shutdown="true"
NameTrans fn="ntrans-j2ee" name="j2ee"
NameTrans fn="assign-name" from="(/|/*)" name="passthrough"
NameTrans fn="map" from="http://haveaniceday:9000" to="http://shire.ida.gov.sg:8080"
NameTrans fn="reverse-map" from="http://shire.ida.gov.sg:8080" to="http://haveaniceday:9000" rewrite-location="true"
NameTrans fn=pfx2dir from=/mc-icons dir="C:/Sun/WebServer6.1/ns-icons" name="es-internal"
NameTrans fn=document-root root="$docroot"
....
and when i restart my web server (haveaniceday), i see this in the error log:
for host haveaniceday trying to GET /portal/dt, func_exec reports: HTTP2122: cannot find function named map
i m using SunOneWebserver 6.1 SP5 with reverse proxy lugin. No proxy server installed.
Please help. Thx !!
# 3
motor's advice applies to Sun Java System Web Proxy Server 4.0, so I'm not sure why he suggested you try it with Sun ONE Web Server 6.1. It won't work.
For information on configuring the reverse proxy plugin, you should start with the documentation at http://docs.sun.com/source/819-0902/rpp61.html
If you have problems after following those instructions, please share a description of the problem along with your errors and access logs and your magnus.conf and obj.conf configuration files.
# 4
Hi,
I configured the Reverse Proxy 6.1 SP3 and Iam having webserver 6.1 SP3.But when iam trying hit the appserver URL from webserver iam getting the following error.
error log
trying to GET /b2b/publicjsp/public_home.jsp, func_exec reports: HTTP2122: cannot find function named error-j2ee
access log
GET /b2b/publicjsp/public_home.jsp HTTP/1.1" 500 305
Obj.conf
NameTrans fn="assign-name" from="/b2b(|/*)" name="passthrough"
<Object name="passthrough">
ObjectType fn="check-passthrough" type="magnus-internal/passthrough"
Service type="magnus-internal/passthrough" fn="service-passthrough" servers="http://3.61.124.177:8080"
</Object>
magnus.conf
Init fn="load-modules" shlib="/appbin/aws/SUNWwbsvr/plugins/passthrough/libpassthrough.so" funcs="init-passthrough,auth-
passthrough,check-passthrough,service-passthrough" NativeThread="no"
And i commented the following part in magnus.conf
#Init fn="load-modules" shlib="/appbin/aws/SUNWwbsvr/bin/https/lib/libj2eeplugin.so" shlib_flags="(global|now)"
# 5
You commented out the directive that loads the j2eeplugin in magnus.conf, but you left the directives that call into the j2eeplugin in obj.conf. The server is understandably upset about that.
# 6
Hi Kami,Did you get resolution to your problem? As even I'm searching for the rev proxy config for similar scenario.Also this specific scenario is not given in http://docs.sun.com/source/819-0902/rpp61.htmlPls. share, if you get any pointers..Tx. Amol.
# 7
Hi Everybody,I too have the same redirection problem with Sun One WebServer. If you have got the correct configuration of obj.conf, please post it here
# 8
Hey All,
I have got a document link regarding this from Sun Support but it is looking for an account with the Sun Service Plan. But I dont have that. If anybody can download that document and send me it would be very helpful. Here is the link...
http://sunsolve.sun.com/search/document.do?assetkey=1-9-75172-1
Thanks in Advance
Jagan
# 9
Hi Jagan,
I am also facing the reversig proxy proble from problem Server 6.1 SP6 to Application Server. Could you please help to download doc in the below link and send it to me ..
http://sunsolve.sun.com/search/document.do?assetkey=1-9-75172-1
Thanks a lot in advance...
Raja.
RAJA at 2007-7-6 15:07:40 >

# 10
Hi All,
Good Morning. Please calrify the below issue about reverse proxy. ( The redirection is not happening from WebServer to AppServer)
- I have installed the one WebServer with below configuration.
- Installed Sun ONE Web Server 6.1SP6 with Sun ONE Web Server 6.1SP3 Reverse Proxy Plugin.
- This is my obj.conf file:
NameTrans fn="assign-name" from="/wps" name="passthrough1"
.
.
.
<Object name="passthrough1">
Service type="magnus-internal/passthrough"
fn="service-passthrough"
servers="http://<AppServer>:9081/wps/"
</Object>
- This is magnus.conf file:
Init fn=flex-init access="$accesslog" format.access="%Ses->client.ip% - %Req->vars.auth-user% [%SYSDATE%] \"%Req->reqpb.clf-request%\" %Req->srvhdrs.clf-status% %Req->srvhdrs.content-length%"
Init fn="load-modules" shlib="/opt/SUNWwbsvr/bin/https/lib/libj2eeplugin.so" shlib_flags="(global|now)"
Init fn="load-modules" shlib="/opt/SUNWwbsvr/plugins/passthrough/libpassthrough.so"
When I am trying to access the WebServer URL http://<WebServer>:<port>/wps/ is not redirting to AppServer URL i.e (http://<AppServer>:9081/wps/).
- Please find the log file as below :-
[26/Nov/2006:10:52:11] warning ( 5727): for host 172.16.5.63 trying to GET /wps/, send-file reports: HTTP4142: can't find /opt/SUNWwbsvr/docs/wps/ (File not found)
- I am confusing it searching the "wps" directory under the doc root directory.
Kindly help to suggest me to resolve the issue.
Thanks a lot in advance.
Best Regards
Elayaraja.K
# 11
For information on configuring the reverse proxy plugin, you should start with the documentation at http://docs.sun.com/source/819-0902/rpp61.html.
If you have problems after following those instructions, please share a description of the problem along with your errors and access logs and your complete magnus.conf and obj.conf configuration files.