Error message when you visit a Web site that is hosted on IIS 7.0: "HTTP Error 502.1 – Bad Gateway"


You have a Web site that is hosted on Internet Information Services (IIS) 7.0. However, when you visit this Web site, you receive an error message that resembles the following:
Server Error in Application "application name"
HTTP Error 502.1 – Bad Gateway
HRESULT: 0x00000000
Description of HRESULT
The CGI application exceeded the time allowed for processing and the process was shut down.


In this situation, IIS sends a request to the specified CGI process, and then IIS waits for a response. If IIS does not receive a response from the CGI process within the configured CGI time-out period, you receive the error message that is mentioned in the "Symptoms" section.


To resolve this problem, debug the CGI application to determine why it is not sending a response to IIS in a timely manner. If debugging the CGI application is not possible, work around this issue by increasing the CGI Timeout property. To do this, follow these steps:
  1. Click Start, click Run, type inetmgr.exe, and then click OK.
  2. In IIS Manager, expand server name, expand Web sites, and then click the Web site that you want to modify.
  3. In Features view, double-click CGI.
  4. Type the appropriate time-out value in the Timeout (hh:mm:ss) text box, press ENTER, and then click Apply.