简体   繁体   English

Azure WebApp 在尝试通过 xyz.azurewebsites.net 访问时抛出 502 页面错误

[英]Azure WebApp throws 502 page error when trying to access over xyz.azurewebsites.net

I am currently building a backend for a website.我目前正在为网站构建后端。 I use Java/Spring boot to build my backend and I am trying to host it on Azure.我使用 Java/Spring boot 来构建我的后端,我试图将它托管在 Azure 上。 I connected my main Branch from GitHub, so every time we merged into main, the changes were live.我从 GitHub 连接了我的主分支,所以每次我们合并到主分支时,更改都是实时的。 I hosted it for several weeks without any problems.我托管了几个星期,没有任何问题。 All of a sudden the application stopped working and we couldn't reach it (Although Azure says it is up and running).突然之间,应用程序停止工作,我们无法访问它(尽管 Azure 说它已启动并正在运行)。 If I try to reach my backend, it takes forever to load and eventually I'll either get an 502 Http Error or "The specified CGI application encountered an error and the server terminated the process.".如果我尝试访问我的后端,它需要永远加载,最终我会得到一个 502 Http 错误或“指定的 CGI 应用程序遇到错误并且服务器终止了进程。”。 I checked, the problem is not that we maxed out our subscription/service-plan.我查了一下,问题不在于我们用尽了订阅/服务计划。 I started the application locally, which worked fine.我在本地启动了应用程序,效果很好。 That led me to the conclusion, that the problem must be Azure, but there are no Errors shown whatsoever.这使我得出结论,问题一定是 Azure,但没有显示任何错误。 I have no idea how to fix the problem and I didn't find any solutions anywhere.我不知道如何解决这个问题,也没有在任何地方找到任何解决方案。 Maybe you can help me.也许你可以帮助我。 Thanks in advance提前致谢

Julius朱利叶斯

Before trying anything try restarting the app as @Josh Van de Walle mentioned if that does't work then here are few workarounds that you can try:-在尝试任何事情之前,请尝试按照@Josh Van de Walle 提到的那样重新启动应用程序,如果这不起作用,那么您可以尝试以下几种解决方法:-

There is a feature in Azure Website called Azure Auto Healing. Azure 网站中有一个名为 Azure 自动修复的功能。 Application issues such as clusters of bad status codes, slow requests or excess memory consumption we can use AutoHeal which ties a trigger to an action to automate.应用程序问题,例如错误状态代码集群、缓慢的请求或过多的 memory 消耗,我们可以使用 AutoHeal,它将触发器与自动操作联系起来。

Here is an example you can take a look at:-这是一个您可以查看的示例:-

<system.webServer>
    <monitoring>
        <triggers>
        
            <!-- Triggers when you have "count" responses matching the configured status within "timeInterval" amount of time -->
            <statusCode>
                <add statusCode="500" subStatusCode="100" win32StatusCode="0" count="10" timeInterval="00:00:30"/>
            </statusCode>
            
            <!-- Triggers when you have "count" number of requests within "timeInterval" amount of time -->
            <requests count="1000" timeInterval="00:10:00"/>

            <!-- Triggers when you have "count" number of requests that take "timeTaken" within "timeInterval" amount of time -->
            <slowRequests timeTaken="00:00:45" count="20" timeInterval="00:02:00" />

            <!-- Triggers when your worker process reaches "privateBytesInKB" kilobytes of private set -->
            <memory privateBytesInKB="800000"/>    
                    
        </triggers>

        <!-- Performs an overlapping recycle of the worker process when a trigger fires -->
        <actions value="Recycle"/>
    </monitoring>
</system.webServer>

Another workaround that you can try checking the logs from your Kudu Console by navigating to D:\home\LogFiles\ from https://<your webapp name>.scm.azurewebsites.net/DebugConsole to make sure what the reason is and work accordingly.另一种解决方法是,您可以尝试通过从https://<your webapp name>.scm.azurewebsites.net/DebugConsole导航到D:\home\LogFiles\从 Kudu 控制台检查日志,以确保原因和工作因此。

Also make sure you are adding WEBSITE_LOAD_USER_PROFILE setting in your app service:还要确保在应用服务中添加WEBSITE_LOAD_USER_PROFILE设置:

WEBSITE_LOAD_USER_PROFILE = 1

REFERENCES:参考:

  1. Configure Azure Auto-Healing for your Azure Web Sites 为您的 Azure Web 站点配置 Azure 自动修复
  2. Use a TLS/SSL certificate in code 在代码中使用 TLS/SSL 证书

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 尝试访问REST Web应用程序时出现404错误 - I'm getting 404 error when trying to access REST webapp Jsoup:尝试访问页面时出现错误307 - Jsoup: error 307 when trying to access a page JSONException:尝试getString(“XYZ”)时没有XYZ的值 - JSONException: no value for XYZ when trying to getString(“XYZ”) 尝试获取InputStream时收到错误502/504 - Getting error 502/504 when trying to get InputStream 尝试在我的应用中获取 azure 访问令牌时出错 - error when trying to get the azure access token in my app 尝试在Spring项目中获取InputStream时出现Http 502错误 - Http 502 Error when trying to get InputStream in my Spring Project 尝试访问其他页面时Liferay应用程序错误 - Liferay application error when trying to access another page Tomcat-Eclipse-尝试访问我的Web应用程序时出现404错误 - Tomcat - Eclipse - 404 Error when trying to reach my webapp Android firebase 在尝试访问存储时抛出身份验证错误 - Android firebase throws authentication error while trying to access storage Selenium 2 hub启动但在尝试访问控制台时抛出404 - Selenium 2 hub starts but throws 404 when trying to access console
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM