IIS+Kestrel: IIS wraps 200 into 400 under load
From @intelli9 on October 16, 2017 8:34
I have ASP.NET Core website hosted by Kestrel behind IIS as reverse proxy. Under relatively high load server responds with 400 Bad Request, higher load - more 400 results up to 100%. I've turned Kestrel logging on and realized website responds with 200. Here is the example of application log and IIS log for the same request:
Kestrel logs:
14:01:58 81.183.220.177 /avatar/2016/1/5AE7.JPG RouteBase Request successfully matched the route with name 'CStaticCdn' and template '{dir}/{*path}'.
14:01:58 81.183.220.177 /avatar/2016/1/5AE7.JPG ControllerActionInvoker Executing action Api.Controllers.StaticCdnController.FileAsync (www.core)
14:01:58 81.183.220.177 /avatar/2016/1/5AE7.JPG ControllerActionInvoker Executing action method Api.Controllers.StaticCdnController.FileAsync (www.core) with arguments (avatar, 2016/1/5AE7.JPG) - ModelState is Valid
14:01:58 81.183.220.177 /avatar/2016/1/5AE7.JPG ControllerActionInvoker Executed action method Api.Controllers.StaticCdnController.FileAsync (www.core), returned result Microsoft.AspNetCore.Mvc.FileContentResult.
14:01:58 81.183.220.177 /avatar/2016/1/5AE7.JPG FileContentResultExecutor Executing FileResult, sending file as
14:01:58 81.183.220.177 /avatar/2016/1/5AE7.JPG ControllerActionInvoker Executed action Api.Controllers.StaticCdnController.FileAsync (www.core) in 0.4742ms
14:01:58 81.183.220.177 /avatar/2016/1/5AE7.JPG WebHost Request finished in 0.981ms 200 image/jpeg
IIS logs:
2017-09-10 12:01:57 81.183.220.177 GET /avatar/2016/1/5AE7.JPG - 46 Mozilla/5.0+(Linux;+Android+5.1;+K4000+Build/LMY47D;+wv)+AppleWebKit/537.36+(KHTML,+like+Gecko)+Version/4.0+Chrome/60.0.3112.107+Mobile+Safari/537.36 https://website.com HU website.com 400 0 737 198
Environment: .NET Core 1.1, net462, Windows Server 2012 R2 (reproduced under Windows Server 2016 too)
Packages used: Microsoft.AspNetCore.Mvc, 1.1.3 Microsoft.AspNetCore.Routing, 1.1.2 Microsoft.AspNetCore.Server.IISIntegration, 1.1.2 Microsoft.AspNetCore.Server.Kestrel, 1.1.2 Microsoft.AspNetCore.Server.Kestrel.Https, 1.1.2 Microsoft.Extensions.Configuration.EnvironmentVariables, 1.1.2 Microsoft.Extensions.Configuration.FileExtensions, 1.1.2 Microsoft.Extensions.Configuration.Json, 1.1.2 Microsoft.Extensions.Logging.Debug, 1.1.2 Microsoft.Extensions.Logging.EventLog, 1.1.2 Microsoft.Extensions.Options.ConfigurationExtensions, 1.1.2 Microsoft.Net.Http, 2.2.29 System.Net.Http, 4.3.2
Copied from original issue: aspnet/Home#2244
I am also facing same issue..any update on this?