I’m using Apache 2.2, JBoss 7.1.3.Final, and Spring 3.2.11.RELEASE. It would appear when Spring issues a redirect in one of our controllers like so
return new ModelAndView(new RedirectView(returnUrl+"?lti_errormsg="+msg));
even though the original page request contained “https,” the new redirect contains only “http”. I believe this might have to do with how Apache connects to JBoss and I was wondering how to adjust our setup so that Spring issues redirects correctly (https for https requests, http for http requests). We are connecting through AJP. Here is our Apache configuration
ProxyErrorOverride On
ProxyPass /myproject/ ajp://localhost:8009/myproject/
RewriteEngine On
RewriteCond %{HTTP:X-Forwarded-Proto} !https
RewriteRule !/ebook/status https://%{SERVER_NAME}%{REQUEST_URI} [L,R]
Pretty simple. Here is the setup in JBoss pertaining to AJP.
<socket-binding-group name="standard-sockets" default-interface="public" port-offset="${jboss.socket.binding.port-offset:0}">
<socket-binding name="management-native" interface="management" port="${jboss.management.native.port:9999}"/>
<socket-binding name="management-http" interface="management" port="${jboss.management.http.port:9990}"/>
<socket-binding name="management-https" interface="management" port="${jboss.management.https.port:9443}"/>
<socket-binding name="ajp" port="8009"/>
<socket-binding name="http" port="8081"/>
<socket-binding name="https" port="8443"/>
<socket-binding name="osgi-http" interface="management" port="8090"/>
<socket-binding name="remoting" port="4447"/>
<socket-binding name="txn-recovery-environment" port="4712"/>
<socket-binding name="txn-status-manager" port="4713"/>
<outbound-socket-binding name="mail-smtp">
<remote-destination host="localhost" port="25"/>
</outbound-socket-binding>
</socket-binding-group>
Let me know what other information I should include or what configuration we need to make so that Spring redirects can take effect properly.
Thanks, - Dave
Edit: Here's how we load the ajp module in the apache httpd.conf file
LoadModule proxy_ajp_module modules/mod_proxy_ajp.so