I am working to get my .net core 1.1 application working behind a load balancer and enforcing https. I have the following setup in my Startup.cs
public void
If you are using a load balancer, it is common to have the load balance terminate the SSL connection and send the request to your application over HTTP.
This worked for me. I am using SSL termination on AWS Load Balancer.
app.UseForwardedHeaders(new ForwardedHeadersOptions
{
ForwardedHeaders = ForwardedHeaders.XForwardedProto
});
What this does is updates the Request.Scheme with the X-Forwarded-Proto header so that all redirects link generation uses the correct scheme.
X-Forwarded-Proto: The scheme from the original client and proxies.