I have a .Net 6 API on a linux container behind an AWS Application load balancer. The load balancer is returning a 502 response for a long running request. The request returns successfully after about a minute when run locally but I get the 502 within 15-19 seconds when running it in PROD behind the load balancer. Load balancer timeout is set to 60 seconds. And I doubt it's the .net timeouts causing it since it runs locally for a minute and returns a 200 response. Also, I haven't configured Keep-Alive or any other timeouts for Kestrel or ASP.Net which means it's using the defaults and, AFAIK, the defaults are all >= 30 seconds.
If it matters, the long running request made by the .net API calls another API configured in a similar manner (AWS load balancer in front of .Net API on linux) and that request is what actually takes a while. The logs for the second load balancer don't have any 5xx errors and if I make the call to the secondary API directly from POSTman, it returns a 200 response after a minute of running.