2017-06-22 96 views
0

這是我的問題 我在Azure Web App上將現有的Nodejs api應用程序從Azure Web App部署到Linux上的Azure Web App。測試的原因是確認Web應用程序的性能與操作系統相同(我一直認爲它在Linux中運行得更快)。部署完成後,我正在使用http:/// api/{查詢的其餘部分}測試GET,它已在NodeJS的路由中配置。Linux上的Azure Web App與502代理錯誤

由於GET查詢的結果,我收到以下錯誤:

<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN"> 
<html> 
    <head> 
        <title>502 Proxy Error</title> 
    </head> 
    <body> 
        <h1>Proxy Error</h1> 
        <p>The proxy server received an invalid 
response from an upstream server. 
            <br /> 
The proxy server could not handle the request 
            <em> 
                <a href="/api/restaurantlist">GET&nbsp;/api/restaurantlist</a> 
            </em>. 
            <p> 
Reason:  
                <strong>Error reading from remote server</strong> 
            </p> 
        </p> 
        <hr> 
        <address>Apache/2.4.18 (Ubuntu) Server at vivaapitest Port 80</address> 
    </body> 
</html> 

希望你能幫助我,如果我需要爲aparche重定向配置.htcaccess改變 任何援助或諮詢會明白!謝謝。

+0

來自API的任何錯誤日誌? –

回答

0

錯誤5xx表示服務器端錯誤。您可以使用Azure CLI 2.0捕獲錯誤日誌,然後查看日誌說的內容。詳情請參閱Capturing stdout in Azure Linux App Service via NodeJs

另請注意,Linux上承載Node.js應用程序的Azure Web App使用PM2來管理Node.js進程。因此,您可能需要specify the PM2 configuration file(而不是.htcaccess)才能用於您的Node.js應用程序。

+0

謝謝。我會仔細檢查一下。它現在似乎正在運行,但沒有返回任何數據。 –

+0

嗨,我試過了,不幸的是,我沒有從日誌中得到任何回覆。當我開始從SailsJS框架調用藍圖API時,只是不斷獲得502錯誤。 –

相關問題