How to hide the version of IIS on Windows Server 2012 R2

Anthony DePinto 1 Reputation point
2023-12-13T20:37:02.6066667+00:00

Trying to hide the version of IIS on our Windows 2012R2 server until we can complete an upgrade. We've used the URL Rewrite module to create an outbound rule however it doesn't work when the server issues a 4xx/5xx errors, the actual version still shows. Is there a way to take care of this with a registry change or some other method? Thanks,

Windows development | Internet Information Services
Windows for business | Windows Server | User experience | Other
0 comments No comments
{count} votes

3 answers

Sort by: Most helpful
  1. Sam Wu-MSFT 7,561 Reputation points Microsoft External Staff
    2023-12-14T06:56:25.2533333+00:00

    @Anthony DePinto

    Do you want to hide the version of iis in response server header? if so, you can try this rule:

    <rewrite>   
      <outboundRules rewriteBeforeCache="true">     
        <rule name="Remove Server header">       
          <match serverVariable="RESPONSE_Server" pattern=".+" />       
          <action type="Rewrite" value="" />     
        </rule>   
      </outboundRules> 
    </rewrite>
    

    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    2 people found this answer helpful.

  2. MotoX80 36,291 Reputation points
    2023-12-14T16:20:05.8466667+00:00

    Set removeServerHeader to true.

    User's image

    2 people found this answer helpful.
    0 comments No comments

  3. Lex Li (Microsoft) 6,037 Reputation points Microsoft Employee
    2023-12-16T22:14:29.97+00:00

    https://halfblood.pro/everything-you-might-need-about-iis-server-header-58ca268547be

    You might choose from option 1 and option 2, but since Windows Server 2012 R2 is too old to support option 3 you won't be able to get rid of the Server header in many cases.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.