gpt4 book ai didi

azure - 应用程序服务重新启动时服务静态 htm

转载 作者:行者123 更新时间:2023-12-03 02:16:41 25 4
gpt4 key购买 nike

我们的网站流量很大,当我们向应用程序部署更新时,应用程序服务将重新启动。重新启动大约需要 4-5 分钟,并且每个访问该页面的用户都会看到“应用程序服务不可用”消息。

wwwroot 中使用 app_offline.htm 不起作用。

重启应用服务时有没有办法提供静态 html 文件?或者离线时?

最佳答案

创建一个默认的 html 文件,其中包含您要显示的内容。

web.config 文件,位于 <system.webServer>标签添加以下代码片段

<system.webServer>
<defaultDocument>
<files>
<clear/>
<add value="index.html"/>
</files>
</defaultDocument>
<system.webServer>

发布您的网络应用程序并检查一次。

  • 要编辑现有的 web.config ,请转到 Azure 门户中的 kudu 控制台并进行编辑。

我们可以在 Azure 门户中设置默认文档选项。

  • 将应用程序部署到 Azure 后。
  • 转到 Azure 门户 => 您的应用程序 => 配置 => 默认文档

enter image description here

关于azure - 应用程序服务重新启动时服务静态 htm,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/70924700/

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