title: ASP.NET Core 2.1 HTTPS Redirection behind AWS Load Balancer?
body: <p><strong>Steps I have taken:</strong>  </p>
  
  <ol>
  <li>Enabled 80 HTTP -> 80 HTTP and 443 HTTPS -> 80 HTTP on my load balancer in Elastic Beanstalk</li>
  <li>Aliased my Route53 hosted zone for both www and apex A records to my load balancer</li>
  <li>Set up the SSL certificate</li>
  <li>Used the default ASP.NET React Template with HTTPS Redirection</li>
  <li>Added <code>&lt;RuntimeIdentifier&gt;win-x64&lt;/RuntimeIdentifier&gt;</code> in .csproj since EB doesn't use 2.1 yet.</li>
  <li>Deployed with Visual Studio AWS Tools</li>
  </ol>
  
  <p><strong>What works:</strong><br>
  <a href="https://www.example.com" rel="nofollow noreferrer">https://www.example.com</a> works<br>
  <a href="https://example.com" rel="nofollow noreferrer">https://example.com</a> works  </p>
  
  <p><strong>What doesn't work:</strong><br>
  <a href="http://example.com" rel="nofollow noreferrer">http://example.com</a> won't redirect to <a href="https://example.com" rel="nofollow noreferrer">https://example.com</a><br>
  <a href="http://www.example.com" rel="nofollow noreferrer">http://www.example.com</a> won't redirect to <a href="https://www.example.com" rel="nofollow noreferrer">https://www.example.com</a></p>
  
  <p>I know in the past you had to write custom extension methods to get this to work with AWS LBs. Does anyone have a working example using the standard templates?</p>