2017-06-22 92 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错误。 –

相关问题