Skip to content

Instantly share code, notes, and snippets.

@brandedoutcast
Last active October 27, 2017 06:44
Show Gist options
  • Save brandedoutcast/2ebe3b92cc13ee3bae2c3b77d7936398 to your computer and use it in GitHub Desktop.
Save brandedoutcast/2ebe3b92cc13ee3bae2c3b77d7936398 to your computer and use it in GitHub Desktop.
Web Config setting to remove / replace unwanted headers in response
<system.web>
<httpRuntime enableVersionHeader="false" />
</system.web>
<system.webServer>
<httpProtocol>
<customHeaders>
<remove name="X-Powered-By" />
<remove name="X-AspNet-Version" />
<remove name="X-AspNetMvc-Version" />
<remove name="X-Powered-By-Plesk" />
</customHeaders>
</httpProtocol>
<rewrite>
<outboundRules rewriteBeforeCache="true">
<rule name="Remove Server Header">
<match serverVariable="RESPONSE_Server" pattern=".+" />
<action type="Rewrite" value="" />
</rule>
</outboundRules>
</rewrite>
</system.webServer>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment