title: ASP.NET Core deployed on IIS returns 502 Error for long running requests
body: <p>I have an ASP.NET Core 2 web application which is hosted on IIS 10 on Windows Server 2012 without any load balancing and special configurations. For some MVC actions which takes too long we get a 502 HTTP error.</p>
  
  <p><a href="https://i.stack.imgur.com/D8Zqy.jpg" rel="noreferrer"><img src="https://i.stack.imgur.com/D8Zqy.jpg" alt="enter image description here"></a></p>
  
  <p>After seeing this error I was shocked, because I didn't have any configuration for a proxy server, etc. And then I remembered that the ASP.NET Core runs on Kestrel. So I came to this conclusion that here IIS plays the role of the proxy server and forwards the requests to the Kestrel. So I think this is somehow related to a timeout configuration, as the other parts of the application works very well. I have searched for similar questions on SO but no luck finding a solution.</p>