【Azure 应用服务】部署Azure Web App时,是否可以替换hostingstart.html文件呢? - LuBu0505/My-Code GitHub Wiki

问题描述

当成功创建一个Web App时,通过高级工具(Kudu)可以查看 Web App的根目录(wwwroot)中有一个默认的文件(hostingstart.html)。它就是应用服务的默认页面。如果没有指定default 或者 index等页面或者Web.config中没有配置rewrite规则,通过URL访问站点时,则会显示hostingstart.html的内容。 https://raw.githubusercontent.com/LuBu0505/My-Code/main/wiki_pic/2021051001.png

那在部署App Service (也称 Web App)时,是否可以替换这个文件或者是用其他文件作为首页呢?

问题分析

当然可以! 在部署时,可以保留hostingstart.html文件,也可以删除它。然后在wwwroot目录中包含 Default.htm, index.html 等文件即可。也可以自定义首页文件,可在App Service门户的配置 -> 默认文档一栏中设置。

https://raw.githubusercontent.com/LuBu0505/My-Code/main/wiki_pic/2021051002.png

注意:第一条记录为优先级最高页面。

参考资料

NA