Asp.net IIS Azure应用程序服务上的SPA应用程序
我已经配置了直接从git存储库将HTML/JS SPA部署到Azure应用程序服务。工作得很好,除了没有重定向到“/”如果我从浏览器打开,比如说“/登录”。相反,我看到的是404Asp.net IIS Azure应用程序服务上的SPA应用程序,asp.net,azure,iis,azure-web-app-service,single-page-application,Asp.net,Azure,Iis,Azure Web App Service,Single Page Application,我已经配置了直接从git存储库将HTML/JS SPA部署到Azure应用程序服务。工作得很好,除了没有重定向到“/”如果我从浏览器打开,比如说“/登录”。相反,我看到的是404 问题是,如果找不到页面,如何将IIS配置为显示“/index.html”,以便在客户端处理“显示什么?”根据您的描述,我建议您可以在web配置中添加元素,以允许您为网站或应用程序配置自定义错误页面 我建议您可以使用KUDU控制台来本地wwwrot文件夹,并添加一个web.config文件,如下所示: <confi
问题是,如果找不到页面,如何将IIS配置为显示“/index.html”,以便在客户端处理“显示什么?”根据您的描述,我建议您可以在web配置中添加元素,以允许您为网站或应用程序配置自定义错误页面 我建议您可以使用KUDU控制台来本地wwwrot文件夹,并添加一个web.config文件,如下所示:
<configuration>
<system.webServer>
<system.webServer>
<httpErrors errorMode="Custom" existingResponse="Auto" defaultResponseMode="ExecuteURL" >
<remove statusCode="404"/>
<error statusCode="404" responseMode="ExecuteURL" path="/index.html" />
</httpErrors>
</system.webServer>
</system.webServer>
</configuration>
根据您的描述,我建议您可以在web配置中添加元素,以允许您为网站或应用程序配置自定义错误页面 我建议您可以使用KUDU控制台来本地wwwrot文件夹,并添加一个web.config文件,如下所示:
<configuration>
<system.webServer>
<system.webServer>
<httpErrors errorMode="Custom" existingResponse="Auto" defaultResponseMode="ExecuteURL" >
<remove statusCode="404"/>
<error statusCode="404" responseMode="ExecuteURL" path="/index.html" />
</httpErrors>
</system.webServer>
</system.webServer>
</configuration>