Skip to content

Instantly share code, notes, and snippets.

@JamoCA
Created December 14, 2021 17:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save JamoCA/c4af2c44e67b76ef3d9956a5a6426069 to your computer and use it in GitHub Desktop.
Save JamoCA/c4af2c44e67b76ef3d9956a5a6426069 to your computer and use it in GitHub Desktop.
IIS Rewrite rules to remove "server" and "x-powered-by" from response headers
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
<rewrite>
<outboundRules>
<rule name="Remove Server">
<match serverVariable="RESPONSE_Server" pattern=".+" />
<action type="Rewrite" />
</rule>
<rule name="Remove Powered-By">
<match serverVariable="RESPONSE_X-Powered-By" pattern=".+" />
<action type="Rewrite" />
</rule>
</outboundRules>
</rewrite>
</system.web>
</configuration>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment