0

I have an application with spring security. I case the user is not authenticated he is redirected to bo/login page.

The problem is that the way i setup the apache web server in front of the tomcat i produce infinite redirection loop:

<VirtualHost *:80>
       ServerName dev.bo.MYDOMAIN.com
       ProxyPass / ajp://localhost:20009/bo/
       ProxyPassReverse / ajp://localhost:20009/bo/
       ProxyPassReverseCookiePath /bo/ /
</VirtualHost>

Does anyone knows how can i prevent the loop in case the user is not authenticated?

mspapant
  • 1,860
  • 1
  • 22
  • 31

3 Answers3

0
<VirtualHost *:80>
  ServerAdmin webmaster@localhost
  ServerName dev.bo.MYDOMAIN.com
  <Proxy *>
    Order deny,allow
    Allow from all
  </Proxy>
  ProxyPass / ajp://localhost:20009/bo/
  ProxyPassReverse / ajp://localhost:20009/bo/
</VirtualHost>

Try the above config

Bharat Chhabra
  • 1,686
  • 2
  • 14
  • 20
-1

Finally i found the problem. I had to proxy also the 'bo' path:

<VirtualHost *:80>
   ServerName dev.bo.MYDOMAIN.com
   ProxyPass / ajp://localhost:20009/bo/
   ProxyPassReverse / ajp://localhost:20009/bo/
   ProxyPass /bo ajp://localhost:20009/bo/
   ProxyPassReverse /bo ajp://localhost:20009/bo/
   ProxyPassReverseCookiePath /bo/ /
</VirtualHost>
mspapant
  • 1,860
  • 1
  • 22
  • 31
-3

Why use mod_jk and mod_proxy? You should just be able to do

ProxyPass / http://localhost:20009/bo/
ProxyPassReverse / http://localhost:20009/bo/

At least you save yourself the protocol switch.

hubbardr
  • 3,153
  • 1
  • 21
  • 27