According to @Tratcher's comment, this was resolved by creating middleware that checks the X-Forwarded headers as follows:
app.Use(async (context, next) =>
{
if (context.Request.Headers.ContainsKey("X-Forwarded-Proto") ||
context.Request.Headers.ContainsKey("X-Forwarded-For"))
{
context.Request.Scheme = "https";
}
await next.Invoke();
});
source
share