title: Spring Security in Grails runnable jar redirects to HTTP
body: <p>I'm using a grails 3 runnable jar with spring Security behind a reverse proxy handling https to http traffic (and https to http redirects), forwarding it to <a href="http://my-host:8080" rel="nofollow noreferrer">http://my-host:8080</a></p>
  
  <p>For all my <code>/login/**</code> calls , grails is sending "302 redirect" to http</p>
  
  <p>For example a <code>/login/authenticate</code> XHR is redirected with the header
  <code>Location: http://my-big-ip/login/ajaxSuccess</code>, etc.</p>
  
  <p>It's not using the <code>serverURL</code> parameter that I set in application.yml to <code>https://my-big-ip</code></p>
  
  <p>My jar is using embedded tomcat since I have this in my build.gradle</p>
  
  <pre><code>compile "org.springframework.boot:spring-boot-starter-tomcat"
  </code></pre>
  
  <p>The logs I get about this redirect</p>
  
  <pre><code>2019-03-27 15:56:34,415 DEBUG http-nio-8088-exec-5  org.springframework.security.web.savedrequest.HttpSessionRequestCache - Removing DefaultSavedRequest from session if present  
  2019-03-27 15:56:34,415 DEBUG http-nio-8088-exec-5  grails.plugin.springsecurity.web.authentication.AjaxAwareAuthenticationSuccessHandler - Redirecting to Ajax Success Url: /login/ajaxSuccess  
  2019-03-27 15:56:34,415 DEBUG http-nio-8088-exec-5  grails.plugin.springsecurity.web.GrailsRedirectStrategy - Redirecting to '/login/ajaxSuccess'
  </code></pre>