【问题标题】:Azure Web App on Linux with 502 proxy errorLinux 上的 Azure Web 应用程序出现 502 代理错误
【发布时间】:2017-06-22 21:29:44
【问题描述】:

这是我的问题 我将现有的 Nodejs api 应用程序从 Azure Web App 部署到 Linux 上的 Azure Web App。测试的原因是为了确认 Web App 的性能在任何操作系统上都是相同的。(我一直认为它在 Linux 中会运行得更快)。部署后,我正在测试一个带有 http:///api/{其余查询}的 GET,它已在 NodeJS 的路由中配置。

作为 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,希望您能帮助我 任何帮助或建议将不胜感激!谢谢。

【问题讨论】:

  • 任何来自 API 的错误日志?

标签: node.js linux azure azure-web-app-service


【解决方案1】:

错误5xx 表示服务器端错误。您可以使用Azure CLI 2.0 捕获错误日志,然后查看日志内容。更多详情请参考Capturing stdout in Azure Linux App Service via NodeJs

另外,请注意,托管 Node.js 应用程序的 Linux 上的 Azure Web App 使用 PM2 来管理 Node.js 进程。因此,您可能需要 specify the PM2 configuration file(而不是 .htcaccess)才能用于您的 Node.js 应用程序。

【讨论】:

  • 谢谢。我会仔细检查。它现在似乎正在运行,但没有返回任何数据。
  • 嗨,我试过了,不幸的是,我没有从日志中得到任何东西。当我开始从 SailsJS 框架调用蓝图 api 时,总是出现 502 错误。
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 2016-11-12
  • 1970-01-01
  • 1970-01-01
  • 2016-05-20
  • 1970-01-01
  • 2019-08-31
  • 1970-01-01
相关资源
最近更新 更多