Forum Moderators: phranque

Message Too Old, No Replies

apache tomcat redirect

         

perl

3:08 pm on Oct 12, 2011 (gmt 0)

10+ Year Member



Hi everyone,
This is my first topic and first time of configuring apache 2.2 as a frontend web server and tomcat server running in backend with aplication.
I have a problem which and cannot find any suitable answers on any forums.
The problem is in using redirecting from apache to tomcat ans using https
apache configs:


<VirtualHost *:80>
ServerName myserver.loc
ProxyPass / ajp://myserver.loc.local:8009/
ProxyPassReverse / ajp://myserver.loc.local:8009/
</VirtualHost>





and ssl.conf:

<VirtualHost *:443>
ServerName myserver.loc

SSLProxyEngine On
SSLEngine on

SSLCertificateFile cert/some.crt
SSLCertificateKeyFile cert/some.pem


ProxyPass / ajp://myserver.loc.local:8009/
ProxyPassReverse / ajp://myserver.loc.local:8009/
</VirtualHost>


Configuration of server.xml in tomcat:


<Connector port="8009"
enableLookups="false"
redirectPort="8443"
protocol="AJP/1.3"
proxyName="myserver.loc"
/>


When going throgh http works fine, when tomcat changes the protocol to https, this is done in application when hitting the login page for example, it doesn`t work anymore, i get the status: 310 ERR_TOO_MANY_REDIRECTS on Chrome.
When forcing to use https by hand it connects and work fine, what does it mean? If tomcat changes the protocol, beetwen http and https it goes back to the same connector and fails because the connector was set for other protocol?
Pleas give me some answers,
Thank you.

phranque

1:12 am on Oct 13, 2011 (gmt 0)

WebmasterWorld Administrator 10+ Year Member Top Contributors Of The Month



i believe you will need to do the canonical protocol redirect in the front end server.