Note that there are some explanatory texts on larger screens.

plurals
  1. POGrails + Tomcat + Apache error when switching to HTTPS
    primarykey
    data
    text
    <p>We have a Grails web application, running in tomcat7 behind Apache2. Everything works fine by using ProxyPass with the ajp protocol:</p> <pre><code>ProxyPass / ajp://localhost:9013/ ProxyPassreverse / ajp://localhost:9013/ </code></pre> <p>where 9013 is our AJP port in tomcat's <code>server.xml</code>.</p> <p>Now, our problem is this however. Our Grails application runs both HTTP and HTTPS. When going to a certain area in the application, Spring Security (Grails Spring Security Core plugin) redirects you from the address using HTTP to HTTPS, for example when hitting:</p> <p><a href="http://www.example.com/secure/path" rel="nofollow">http://www.example.com/secure/path</a></p> <p>Spring Security will redirect you to:</p> <p><a href="https://www.example.com/secure/path" rel="nofollow">https://www.example.com/secure/path</a></p> <p>But now, when it redirects there, the server hangs and finally Firefox gives the <em>"Firefox has detected that the server is redirecting the request for this address in a way that will never complete."</em> error.</p> <p>Am I correct in assuming that some redirecting with the AJP proxy is going bad? Can anyone provide some more information regarding how this setup will work?</p> <hr> <p>On looking further, we have found the following:</p> <p>When hitting the application in tomcat directly (via IP and ports) everything works 100%. But as soon as we go through Apache, the Spring Security redirect does not work. you keep getting the following in the Apache logs:</p> <pre><code>staging.server.com:80 41.133.194.248 - - [05/Apr/2012:14:03:41 +0200] "GET /user/signup HTTP/1.1" 302 223 "http://staging.server.com/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:11.0) Gecko/20100101 Firefox/11.0" staging.server.com:80 41.133.194.248 - - [05/Apr/2012:14:03:42 +0200] "GET /user/signup HTTP/1.1" 302 223 "http://staging.server.com/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:11.0) Gecko/20100101 Firefox/11.0" staging.server.com:80 41.133.194.248 - - [05/Apr/2012:14:03:42 +0200] "GET /user/signup HTTP/1.1" 302 223 "http://staging.server.com/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:11.0) Gecko/20100101 Firefox/11.0" staging.server.com:80 41.133.194.248 - - [05/Apr/2012:14:03:42 +0200] "GET /user/signup HTTP/1.1" 302 223 "http://staging.server.com/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:11.0) Gecko/20100101 Firefox/11.0" </code></pre> <p>...</p> <p>rather than redirecting to https it seems apache magically makes it try http again. Thanks</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload