logo
Apache Lounge
Webmasters

 

About Forum Index Downloads Search Register Log in RSS X


Keep Server Online

If you find the Apache Lounge, the downloads and overall help useful, please express your satisfaction with a donation.

or

Bitcoin

A donation makes a contribution towards the costs, the time and effort that's going in this site and building.

Thank You! Steffen

Your donations will help to keep this site alive and well, and continuing building binaries. Apache Lounge is not sponsored.
Post new topic   Forum Index -> Apache View previous topic :: View next topic
Reply to topic   Topic: Apache mod_rewrite before mod_jk
Author
Qmpeltaty



Joined: 06 Feb 2008
Posts: 182
Location: Poland

PostPosted: Mon 09 Jun '08 11:51    Post subject: Apache mod_rewrite before mod_jk Reply with quote

I have problem with forcing https for mod_jk worker. For sites hosted by Apache (not forwarded to tomcat through mod_jk) my config looks like this :

Alias /alias_to_secure "/www/alias_to_secure/"

<Directory "/www/alias_to_secure/">
Options Indexes FollowSymLinks MultiViews
AllowOverride all
Order Deny,Allow
Allow from all
RewriteEngine On
RewriteCond %{HTTPS} !^on$
RewriteRule (.*) https://%{HTTP_HOST}/alias_to_secure/$1 [L,R]

</Directory>

<LocationMatch /alias_to_secure/.*>
AuthType Digest
AuthName "/alias_to_secure"
AuthUserFile "/passwd/digest"
require valid-user
</LocationMatch>

My question is how to do same thing with mod_jk workers ? I can't use Alias directive couse there is no directory for mod_jk workers.
Back to top
James Blond
Moderator


Joined: 19 Jan 2006
Posts: 7371
Location: Germany, Next to Hamburg

PostPosted: Wed 09 Jul '08 22:43    Post subject: Reply with quote

Isn't there any chance to do that by your jsp code? I mean forcing SSL

Code:

<% String requestURL = request.getRequestURL().toString(); %></b>
<b>Request URL = <%=requestURL%></b>
<%if(requestURL.substring(0,requestURL.indexOf(':')).equals("http")){
response.sendRedirect("https://server/somewhere/");
} %>
Back to top


Reply to topic   Topic: Apache mod_rewrite before mod_jk View previous topic :: View next topic
Post new topic   Forum Index -> Apache