I've got a .NET Core 2.2 Web API project running behind a load balancer. The load balancer has a timeout set to 60 seconds. I'd like to set the timeout in my app at 55 seconds so I can clean things up and return a customized message to the caller.
I see that it is possible to set the timeout in the web.config if the app is running under IIS, but my app is running under Kestrel in a Linux based docker container.
I tried the following but it didn't work.
var builder = WebHost.CreateDefaultBuilder(args)
.ConfigureKestrel((context, options) =>
{
options.Limits.KeepAliveTimeout = TimeSpan.FromSeconds(10);
});