In IIS 7.0
integrated mode
after deleting all headers with Response.ClearHeaders()
IIS would add some other headers like Server
Would like to add here that for the ASP.NET Core versions where there is no longer a web.config file a different approach is necessary.
I made the following adjustments to remove the headers in ASP.NET Core 2.1:
You can remove the x-powered-by header by replacing
with
in the applicationhost.config file found in the .vs\config folder of the project.
The server header can be removed by adding
.UseKestrel(c => c.AddServerHeader = false)
in the Program.cs file.