Ross
Ross

Reputation: 2141

ASPX.NET Core - random 502 error on IIS server

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!

Upvotes: 7

Views: 3036

Answers (1)

Dmitry
Dmitry

Reputation: 16795

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.

Upvotes: 2

Related Questions