MVC调用返回 502
ajax postman
IIS 调用一个接口返回 502 - Web server received an invalid response while acting as a gateway or proxy server.
public ActionResult ExecuteThingsOne()
{
if (Monitor.TryEnter(objInLock))
{
try
{
// 准备数据(耗时约10秒)
......
// POST 同步调用接口(耗时约60秒)
......
return Content(new Result {Success = true }.ToJson());
}
catch (Exception ex)
{
return Content(new Result {Success = false}.ToJson());
}
finally
{
Monitor.Exit(objInLock);
}
}
else
{
return Content(new Result{Success = false }.ToJson());
}
}
回答
你的请求是通过反向代理server到达IIS MVC程序的吧