I deployed a docker image that houses a .Net 6 core console application, but the actual deployed site keeps giving the error of “ERR_TOO_MANY_REDIRECTS”. I have the following settings for Startup.cs file:
app.UseHttpsRedirection();
app.UseRewriter(new RewriteOptions().AddRedirectToHttpsPermanent());
app.Use((context, next) =>
{
context.Request.Headers.Add(“X-Forwarded-Proto”, “https”);
return next();
});
What do I need to do in order to get rid of this infinite looping of redirecting? It seems like the redirecting is always back to the same URL as well.