我的页面上开始出现随机502错误。这与Azure或我的网站有关吗?自星期四以来我没有做任何改动,所以我对成为我的代码持怀疑态度。
502 - Web server received an invalid response while acting as a gateway or proxy server. There is a problem with the page you are looking for, and it cannot be displayed. When the Web server (while acting as a gateway or proxy) contacted the upstream content server, it received an invalid response from the content server.
我正在检查日志,但它说的只是它发生在哪个网址上,并且它发生在主根页面上。
答案 0 :(得分:0)
在我的情况下,这是因为代码中的无限循环,它只在生产中触发,而不是在我的本地机器上触发。修复无限循环显然修复了502.; - )
更新:无限循环的元例子(C#)。
public IList<Model> PropertyOne
{
get
{
return !_productionOnlyCondition ? _models.ToList() : PropertyTwo;
}
}
public IList<Model> PropertyTwo
{
get
{
return PropertyOne.Where(model => model.Condition).ToList();
}
}