'The specified CGI application encountered an error and the server terminated the process. - timeout issue

Getting below error for API which takes around 2-4 minute to process

Code:502 Error: Bad Gateway The specified CGI application encountered an error and the server terminated the process.

I have a webjob which calls an web API hosted in azure app server developed in .net core 3.1. Webjob has httclient timeout set to 5 min but the API times out within 2 mintues.

Tried below fix in the web app but doesn't work

 webBuilder.UseKestrel(o =>
             {
                 o.Limits.KeepAliveTimeout = TimeSpan.FromMinutes(10);
                 o.Limits.RequestHeadersTimeout = TimeSpan.FromMinutes(10);
             });

How to increase the server timeout?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source