答案1
我必须调整标签:
<httpErrors errorMode="DetailedLocalOnly" />
这是在“system.webserver”标签内。我之前设置为“详细”
https://docs.microsoft.com/en-us/iis/configuration/system.webserver/httperrors/
答案2
您可以修改 web.config.xml 甚至创建自定义错误页面。
<!-- CUSTOM ERROR MESSAGES
Set customErrors mode="On" or "RemoteOnly" to enable custom error messages, "Off" to disable.
Add <error> tags for each of the errors you want to handle.
"On" Always display custom (friendly) messages.
"Off" Always display detailed ASP.NET error information.
"RemoteOnly" Display custom (friendly) messages only to users not running
on the local Web server. This setting is recommended for security purposes, so
that you do not display application detail information to remote clients.
-->
<customErrors mode="RemoteOnly"/>
参考:https://docs.microsoft.com/en-us/iis/configuration/system.webserver/httperrors/
答案3
无法编辑该详细错误页面,因为它由特定的内置处理程序处理。不过,正如其他人提到的那样,解决此问题的正确方法是将 errorMode 更改为“DetailedLocalOnly”。这将仅向“本地”用户(即在与 IIS 相同的系统上运行的浏览器)显示这些详细错误页面。如果您需要为源自服务器的请求收集此类信息,您还可以在 FREB 跟踪中看到大部分此类信息。
更多信息: https://docs.microsoft.com/en-us/iis/configuration/system.webserver/httperrors/ https://docs.microsoft.com/en-us/iis/troubleshoot/diagnosing-http-errors/how-to-use-http-detailed-errors-in-iis