Hi,

our configuration is a Apache 2.2 web server, acting as a reverse
proxy for Tomcat 6. This is the configuration:
ServerName    it.localhost.de
ProxyPass               /       ajp://127.0.0.1:8009/spike/
ProxyPassReverse        /       ajp://127.0.0.1:8009/spike/
ProxyPassReverseCookiePath      /spike  /

As you can see, the webapp is hosted under ContextPath /spike but
available through the proxy via /. Everything works fine, until the
webapp sends an redirect to HTTPS. This is done via SpringSecurity.
The problem is, that the ProxyPassReverse directive doesn't catch the
ContextPath and converts it, if it includes the complete address.
These are the logs from the web browser:

GET http://it.localhost.de/users/65 => 302 =>
https://it.localhost.de/spike/users/65

1) Why does the ProxyPassReverse doesn't convert the /spike back to /
in https://it.localhost.de/spike/users/65? Is it because the Header
isn't relative? The protocol is still AJP and so the Proxy should know
how to convert it, right?
1a) If so, how could the webapp switch from http to https and vice
versa, when not able to send the absolute address with a new protocol?

After this, I tried to set additional ProxyPassReverse directives:

ProxyPassReverse    /    https://it.localhost.de/spike/
ProxyPassReverse    /    http://it.localhost.de/spike/

This time, the /spike/ is converted to /, but the two directives leads
to an infintive loop of redirects to
http://it.localhost.de/<REQUEST-URI>.

2) How can I stop this loop? or better
3) How can I configure the ProxyPassReverse correctly?

As a workaround I have a RewriteRule added like this one

RewriteRule     ^/spike/(.*)$   /$1     [R=301,L]

but this doesn't feel correct and it leads to 3 GET-Requests and
redirects each time the webapps wants it user to switch the protocol.


Thank you very much
Timo Meinen

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org

Reply via email to