【发布时间】:2017-10-17 10:38:26
【问题描述】:
我已经将一个 ASP.NET MVC 部署到 Azure,并且用户通过使用客户端证书登录。 在本地,如果用户不发送证书或证书无效,网站会将用户重定向到 /error/403 端点。 但是在 Azure 上这不起作用:用户没有重定向到 /error/403 并且显示的页面总是这样的:
这是我在 <system.webServer> 节点内的 Web.Config 代码:
<httpErrors errorMode="Custom" existingResponse="Replace">
<clear />
<error statusCode="400" path="/error/400" responseMode="Redirect" />
<error statusCode="404" path="/error/404" responseMode="Redirect" />
<error statusCode="500" path="/error/500" responseMode="Redirect" />
<error statusCode="501" path="/error/501" responseMode="Redirect" />
<error statusCode="503" path="/error/503" responseMode="Redirect" />
</httpErrors>-->
我还尝试使用customErrors 节点添加<httpErrors existingResponse="PassThrough" /> 或将我的代码从system.webServer 移动到system.web,但似乎用户被阻止之前 网络。配置已读取。对于我尝试的每个更改,行为都保持不变。
我该如何解决?谢谢
【问题讨论】:
-
HTTP 状态 403 Forbidden 表示您无权访问该页面。当登录用户无权查看页面时,您可以自行返回,但在这种情况下,返回错误的是 Azure 平台,而不是您的应用程序。
-
有没有办法在 Azure 中编辑此设置?我的意思是,用自定义蓝屏更改默认蓝屏。不幸的是,我在 Azure 门户上没有找到任何东西
-
@Krusty 有什么消息吗?解决方法?
-
不,因为我离开了公司,所以我停止了那个项目的工作。对不起
标签: asp.net azure web-config certificate