Force SSL Web Server Hack
I've finally gotten around to upgrading my personal website from Sun Java System Web Server 6.1 to 7.0 - as well as a refresh of JSPWiki
As I have been doing the migration, one of the things I ran across was a method I have for forcing a URLs to the SSL/HTTPS port of the web server. For example, I have a WebMail application installed that I occasionally use. The web server is configured to serve both Plain HTTP and SSL HTTP requests. But in this case I don't want to be able to access the WebMail application over plain HTTP. How do I force SJSWS to redirect any plain HTTP requests to the SSL? Its really pretty easy.
This works for both 6.1 and 7.0. All you really do is edit the obj.conf (or with 7.0, it might be node-obj.conf) and add a Client tag to the beginning of the "default" Object of the form:
<Client match="all" security="false"> NameTrans fn="redirect" from="/webmail" url-prefix="https://server.org/webmail" NameTrans fn="redirect" from="/webmail/*" url-prefix="https://server.org/webmail/" </Client>
What this is saying is, for any request that is over plain HTTP (security="false") evaluate, the included NameTrans parameters. In this case, any request starting with webmail will be redirected to the SSL port.
The Client tag can perform much more complex evaluations. For example, one thing that can be handy is to limit the evaluation of the inner directives to a specific virtual host. To do that, Simply add a urlhost attribute:
<Client match="all" security="false" urlhost="server.org"> NameTrans fn="redirect" from="/webmail" url-prefix="https://server.org/webmail" NameTrans fn="redirect" from="/webmail/*" url-prefix="https://server.org/webmail/" </Client>

Posted by kneeL on December 18, 2006 at 11:52 AM PST #
Posted by kneeL on December 18, 2006 at 01:39 PM PST #
Posted by Robert on December 26, 2006 at 03:42 PM PST #
Posted by ttyty on June 24, 2007 at 09:54 AM PDT #
are you my uncle in n.y. ?
Posted by Robert E. Mocker on March 30, 2008 at 02:46 PM PDT #