azure - web.config 中的位置 + 路径在 Azure 中不起作用
问题描述
刚刚创建了一个新的 Asp.Net Core MVC 应用程序并将其发布到 Azure。
通过将位置/路径元素添加到 web.config 并重新发布站点....我的 azure-app 立即损坏。
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<location path="authenticate" allowOverride="true">
<system.webServer>
<security>
<access sslFlags="SslNegotiateCert" />
</security>
</system.webServer>
</location>
</configuration>
为什么以下内容在 Azure Web App 中不起作用?
解决方案
假设您想限制用户访问身份验证文件夹下的任何内容,您能否尝试以下代码:-
以下 web.config 示例将元素中的任何设置仅应用于位于站点 /authenticate 目录中的任何资源:
<location path="~/authenticate" allowOverride="true">
<system.webServer>
<security>
<access sslFlags="SslNegotiateCert" />
</security>
</system.webServer>
</location>
如果它不起作用,您能否启用下 system.web 并让我知道您遇到了什么错误。
推荐阅读
- wxwidgets - 如何让 Eclipse CDT 在 Windows 下与 WxWidgets 一起工作?
- r - 如何处理分类变量中的 NA 值?
- c# - 多次调用 FileSystemWatcher 事件
- javascript - 如何使用 SortableJS 和 jQuery 获取嵌套列表的顺序
- android - 如何创建一个包含 PDF 并在主页上显示的 APK
- python - 我正在使用 tkinter 在 python 中创建测验,但是当我尝试获得分数时,它并没有给我分数
- javascript - 如何在反应表中进行默认排序
- java - java.lang.NullPointerException 正在生成
- cucumber - 执行 Cucumber TestRun 文件时出现以下错误
- excel - 通过 xlwt 的 Excel 文件保护不适用于 Mac 的号码