title: Spring Boot with Embedded Tomcat behind AWS ELB - HTTPS redirect
body: <p>Running Spring boot application port 8080 on EC2 instance.</p>
  
  <p>AWS ELB configured to redirect </p>
  
  <pre><code>     80 -&gt; 8080
       443 (SSL termination happens here) -&gt; 8080
  </code></pre>
  
  <p>Application uses Spring Security and if you user arrives to <a href="http://example.com" rel="nofollow">http://example.com</a> it will redirect to . I would like to login page to use SSL. </p>
  
  <p>Spring security snippet:</p>
  
  <pre><code> http.requiresChannel().antMatchers("/login", "/logout").requiresSecure();
  </code></pre>
  
  <p>We are running into redirect loop which makes sense. </p>
  
  <p>To Spring Boot application it looks like all requests are made to non-secured port 8080, it redirects to <a href="https://example.com" rel="nofollow">https://example.com</a>, goes through ELB and again gets request on 8080</p>
  
  <p>Any ideas on how to run this with AWS ELB ???</p>