I have a .NET 6 Blazor Server and another .NET 6 Blazor Wasm site. Both work fine locally but when hosted on a shared hosting site get an error 'too many redirects'. I can't change any setup on the shared hosting so am restricted to web.config & source startup code.
After investigation, the startup code in program.cs
app.UseHttpsRedirection();
is causing the issue. If I comment that out the application works, but if you use an http address it doesn't get redirected to https - so no good. This all happened after I had to set web.config to use out of process hosting model (required by shared hosting when using multiple apps).
<aspNetCore processPath="dotnet"
hostingModel="outofprocess" ...
This question was very helpful in discovering the issue. The same site produces "too many redirects" only via cellular, not via WiFi. I also tried forwarding headers as in https://learn.microsoft.com/en-us/aspnet/core/host-and-deploy/proxy-load-balancer?view=aspnetcore-6.0, but nothings helps.
I'm out of things to try. Any suggestions would be appreciated.