簡體   English   中英

Azure 502 Web服務器充當網關時收到無效響應

[英]Azure 502 web server received an invalid response while acting as a gateway

我開始在頁面上隨機出現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.

我正在檢查日志,但是它說的只是它發生在哪個URL,它發生在主根頁面上。

在我的情況下,這是由於代碼中的無限循環所致,該循環僅在生產中觸發,而不在我的本地計算機上觸發。 修復無限循環顯然可以修復502。;-)

更新:無限循環(C#)的元示例。

public IList<Model> PropertyOne
{
    get
    {
        return !_productionOnlyCondition ? _models.ToList() : PropertyTwo;
    }
}

public IList<Model> PropertyTwo
{
    get
    {
        return PropertyOne.Where(model => model.Condition).ToList();
    }
}

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM