How to Diagnose IIS Errors Without Exposing Server Details
An HTTP 500 page tells the caller that the request failed, but it may hide the cause. Diagnose the failing request on the server and keep the public response controlled. The old /IISHelp/common/500-100.asp error-page recipe is not needed on IIS 10.
Establish the exact failure
Reproduce the request once and record its URL, time, status and IIS substatus. Find the matching W3C log entry. If the error originates before the application runs, its exception logger may have nothing to record.
In an elevated Windows PowerShell session, inspect the error policy for the test application:
$appcmd = Join-Path $env:windir 'System32\inetsrv\appcmd.exe'
$appPath = 'Default Web Site/Demo'
& $appcmd list config $appPath /section:system.webServer/httpErrors
If local detailed errors are appropriate, set and read back that exact policy:
& $appcmd set config $appPath /section:system.webServer/httpErrors /errorMode:DetailedLocalOnly /commit:apphost
if ($LASTEXITCODE -ne 0) { throw 'Error policy was not saved.' }
& $appcmd list config $appPath /section:system.webServer/httpErrors
The expected readback is errorMode="DetailedLocalOnly". Test both a local request and a genuinely remote request to an intentionally failing test endpoint. The latter must not expose physical paths, connection details or stack traces. Remove the test endpoint afterward.
Trace one failure when the response is insufficient
If the IIS Tracing role service is installed, enable Failed Request Tracing for the selected site and add a rule for the observed status. Reproduce once, inspect the resulting trace and identify the module and notification that set the error. Bound the number of retained files and disable the temporary rule when finished.
Application frameworks and Classic ASP have their own error-output controls. IIS httpErrors is not a universal switch for every exception page. Also consider how a local reverse proxy affects locality. Locality at IIS may not equal locality of the original visitor. Verify the externally served response instead of relying only on the setting's name.
References


Author: Herman Schoenfeld