This content has been marked as final. Show 6 replies
<If $url =~ "http://jbossserver:8080/action/*">
NameTrans fn="redirect" url="/maintenance.html"
Thanks for the reply. Unfortunately, it doesn't work.
What doesn't work? You need to clearly specify what is not working in order to get help? Also what is the rest of your config? Are your config settings in the correct order? I am assuming the web server is actually also acting as a reverse proxy for your jboss server? Btw, jboss is an application server, not a web server.
You're right, jboss is an app server. I have tried what you had suggested, and I got an "Unable to connect" error. It seems like webserver is not listening to port 8080. There is no error from the access or error log. It is back to where I was before trying out different variables.
Another thing, I didn't setup reverse proxy. Do I need to? Is it difficult to setup? I am not familiar with reverse proxy. In the pass, I was using Netscape/SunOne web server page redirection. All I recall was, in the URL redirects page, I just set from and to boxes and it worked with no problem. With webserver 7, there are so much changes. Actually, I have been using webserver 7 for more than a year, but never has to touch the URL Redirects page. I only use it for simply task like directory mapping for files upload/download and never expect to setup the page redirection.
Here are the full code from <hostname>-obj.conf, assume the hostname is jboss in this case:
AuthTrans fn="match-browser" browser="*MSIE*" ssl-unclean-shutdown="true"
NameTrans fn="ntrans-j2ee" name="j2ee"
NameTrans fn="pfx2dir" from="/mc-icons" dir="/usr/local/webserver7/lib/icons" name="es-internal"
<If $url =~ 'http://jboss:8080/action/*'>
NameTrans fn="redirect" url-prefix="/test.html"
PathCheck fn="check-acl" acl="default"
PathCheck fn="find-index" index-names="index.html,home.html,index.jsp"
ObjectType fn="force-type" type="text/plain"
Service method="(GET|HEAD)" type="magnus-internal/directory" fn="index-common"
Service method="(GET|HEAD|POST)" type="*~magnus-internal/*" fn="send-file"
Service method="TRACE" fn="service-trace"
Service fn="service-j2ee" method="*"
PathCheck fn="check-acl" acl="es-internal"
ObjectType fn="force-type" type="magnus-internal/cgi"
Output fn="insert-filter" filter="http-compression"
Service fn="proxy-retrieve" method="*"
Thank you for your help!
Actually, redirection isn't your problem. If your jboss server was listening on 8080 and you shut it down for maintenance, then nothing is listening on that port, hence nothing can connect to it. What you need to do is add a listener on iws7 to listen on that port so that it can actually receive the request to redirect.
Thanks for the explanation. It is funny you mentioned adding a new listener. I did that today. Instead of adding a new listener, I added a new virtual server with a new listener with new port and it worked fine.
I do have another question, why the asterisk (*) is not working the way it should when adding in the pattern for wild card. I can never get it working. With the new listener, in the url box, I set "//" instead "/*" and it work fine, but not with asterisk. I use that a lot in app server for the url pattern and asterisk just work fine, but not in iws7.
Anyway, thank you for your help. At least, I am in the right track now.