繁体   English   中英

Azure网站404 index.html

[英]Azure websites 404 index.html

我试图在Azure网站上运行我的应用程序,但是我无法使index.html正常工作。

该应用程序存在于2个项目中:

  • api(.net核心)
  • 客户(角度)

在我的构建定义中,我将客户端和Api的结果复制到$(Build.ArtifactStagingDirectory) ,然后发布

到目前为止,到目前为止,我可以在我的网站的wwwroot中看到来自客户端的文件(通过kudu控制台)

但是当我导航到index.html ,我得到了404 但是转到/api/...链接只是按预期工作

所以我在想问题是我的web.config覆盖了导航到index.html文件的可能性。

web.config

<configuration>
  <system.webServer>
    <handlers>
      <add name="aspNetCore" path="*" verb="*" modules="AspNetCoreModule" resourceType="Unspecified" />
    </handlers>
    <aspNetCore processPath="dotnet" arguments=".\Portal4Fun.Api.dll" stdoutLogEnabled="false" stdoutLogFile=".\logs\stdout" forwardWindowsAuthToken="false" />
  </system.webServer>
</configuration>

在.net Core中,您需要确保使用的是静态文件中间件,请参阅静态文件文档以了解如何添加它-默认情况下,该文件应位于新的.net Core项目中。 没有此中间件,将不会提供静态文件-例如。 * .css,*。js,*。html等!

暂无
暂无

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM