I'm trying to determine the cause of a 500 server error I'm seeing in the diagnostics logs for my AspNetCore 2.1.5 app that's running in an Azure App Service instance:
HTTP Error 500.53 - URL Rewrite Module Error. Outbound rewrite rules cannot be applied when the content of the HTTP response is encoded ("gzip").
Symptoms include:
- Incomplete HTML responses (A 200 status code is returned, but occasionally only a portion of the content is displayed - refreshing the page 1-3 times usually fixes this)
- Frequently slow response times ~10-40 sec - it's as if the app isn't warmed up.
Possibly Relevant Information:
- Application insights doesn't show any of these failures or slow response times anywhere.
- I'm not explicitly using any rewrite rules in my config.
- Calling/Not Calling app.UseResponseCompression() in startup doesn't make a difference
- Calling/Not Calling app.UseHttpsRedirection() in startup doesn't make a difference
- Enabling/Disabling "Https Only" in the azure portal doesn't make a difference
- I'm not seeing any problems locally
- Scaling between B1,B2,S1,S2 app service plans doesn't make a difference
- Turning off https only and using non-ssl endpoints doesn't make a difference
Here's my WebHostBuilder call:
WebHost.CreateDefaultBuilder(args)
.ConfigureAppConfiguration((hostingContext, config) =>
{
config.SetBasePath(Directory.GetCurrentDirectory());
})
.UseSerilog()
.UseStartup<Startup>()
.UseApplicationInsights();
The only similar results I find when Googling for this are 500.52 errors, but they're always related to incorrect url rewrite rules which I'm not (explicity) using.