gpt4 book ai didi

node.js - Linux 上的 Azure Web 应用出现 502 代理错误

转载 作者:太空宇宙 更新时间:2023-11-04 12:25:57 25 4
gpt4 key购买 nike

这是我的问题我将现有的 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,希望你能帮助我任何帮助或建议将不胜感激!谢谢。

最佳答案

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

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

关于node.js - Linux 上的 Azure Web 应用出现 502 代理错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44709690/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com