We just launched a site that runs on ASP.NET Core 1.1, Windows 2008R2, IIS 7.5 with all the latest patches to 2008 and asp.net. The site runs fine, but goes down with no apparent pattern. All of a sudden it would start returning 502 response:
502 – Web server received an invalid response while acting as a gateway or proxy server
Restarting the site in IIS, or recycling site’s application pool brings the site up, but the problem reoccurs within a few hours. As workaround, we configured IIS to recycle app pool every 90 minutes, and that seemed to keep the site up all of the time. Any recommendations on how to troubleshoot this problem?
Thank you!
Resolving The ProblemSet the IIS Application Request Routing (ARR) timeout to a higher setting. The default is 120 seconds, at which point ARR times out the request. Test setting the timeout to 160 and restarting the IIS server.
HTTP 502 - Overview. When working with IIS Application Request Routing (ARR) deployments, one of the errors that you may see is "HTTP 502 - Bad Gateway". The 502.3 error means that - while acting as a proxy - ARR was unable to complete the request to the upstream server and send a response back to the client.
IIS says with this 502 error that Kestrel (behind it) returned something "wrong". Enable (more) logging, and inspect logs before first 502 response. Some previous request "breaks" your app.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With