I use the following custom headers and rewrite rules to remove server response headers IIS 8.5 but when open the network monitor on Firefox or Chrome and point to any file with status 404 (as well as missing images) or 302 (as well as missing directory or requested file in aspxerrorpath redirection) enables me to see the original headers.
For example Microsoft website is hiding this information and headers but visiting a URL like this will let me easily determine the server and IIS version which are:
Server Microsoft-IIS/10.0
X-AspNet-Version 4.0.30319
X-Powered-By ASP.NET
<system.webServer>
<httpProtocol>
<customHeaders>
<remove name="X-Powered-By-Plesk" />
<add name="Server" value="CustomName" />
</customHeaders>
</httpProtocol>
<rewrite>
<outboundRules rewriteBeforeCache="true">
<rule name="Remove Headers 1">
<match serverVariable="RESPONSE_Server" pattern=".+" />
<action type="Rewrite" value="" />
</rule>
<rule name="Remove Headers 2" patternSyntax="ExactMatch">
<match serverVariable="RESPONSE_SERVER" pattern=".*" />
<action type="Rewrite" value="" />
</rule>
</outboundRules>
</rewrite>
</system.webServer>
Is there anyway to fix this from IIS 8.5 or Web.Config without having to do this from my ASP.NET C# code?