【发布时间】:2020-12-13 07:12:27
【问题描述】:
我正在尝试让我们现有的 asp.NET core mvc 应用程序在 azure 应用程序服务中运行。部署工作正常,我期望的所有文件都在服务器上。
遗憾的是,在尝试访问该 url 后,我收到消息“您无权查看此目录或页面”。这是状态码 403。
日志提供了更多见解:
<div id="content"><div class="content-container"><h3>HTTP Error 403.14 - Forbidden</h3><h4>The Web server is configured to not list the contents of this directory.</h4></div><div class="content-container"><fieldset><h4>Most likely causes:</h4><ul> <li>A default document is not configured for the requested URL, and directory browsing is not enabled on the server.</li> </ul></fieldset></div><div class="content-container"><fieldset><h4>Things you can try:</h4><ul> <li>If you do not want to enable directory browsing, ensure that a default document is configured and that the file exists.</li> <li> Enable directory browsing using IIS Manager. <ol> <li>Open IIS Manager.</li> <li>In the Features view, double-click Directory Browsing.</li> <li>On the Directory Browsing page, in the Actions pane, click Enable.</li> </ol> </li> <li>Verify that the configuration/system.webServer/directoryBrowse@enabled attribute is set to true in the site or application configuration file.</li>
似乎我应该使用某种登录页面,例如 index.html,但给定的 mvc 项目不存在。
我也找不到此配置的任何文档。即使是展示托管 mvc 应用程序是多么容易的 youtube 视频也无需进行任何进一步的配置。 (比如这个:watch)
如果有人能告诉我哪里出错了,我会很高兴。
提前致谢,
约书亚
【问题讨论】:
-
您是否尝试将“配置、默认文档”中的项目更改为适合您的场景?
-
好吧,因为它是一个 mvc 应用程序,所以没有“默认文档”。 wwwroot 文件夹包含我的应用程序的 .dll 文件和我的应用程序的 .exe 文件。此 mvc 项目不存在静态 html 文件。
标签: azure model-view-controller azure-web-app-service