Post

删除 IIS 中 Header 里面的 Server Header

如果不考虑使用第三方控件实现,可以用PowerShell的方式:

1
Set-WebConfigurationProperty -pspath 'MACHINE/WEBROOT/APPHOST' -filter "system.webServer/security/requestFiltering" -name "removeServerHeader" -value "True"

大概是修改IIS的配置:

C:\Windows\System32\inetsrv\config\applicationHost.config

1
2
3
4
5
6
7
<system.webServer>
  <security>
     <requestFiltering removeServerHeader="true">
      //...
           <requestFiltering>
      <security>
<system.webServer>

参考:

EOF


Power by TeXt.

This post is licensed under CC BY 4.0 by the author.