The setup is as follows:
Windows Server 2022 Standard with IIS 10.
ASP .NET 4.8 based application, running with Integrated mode
and Application Pool Identity
.
Im trying to remove the following headers:
Server
, X-Powered-By
, X-ASPNet-Version
, X-ASPNetMVC-Version
.
No matter what is done, the headers remain.
Things tried:
Remove on server level from
RESPONSE HEADERS
theX-Powered-By
header - no effect, still shows up on dynamic content.Set enableVersionHeader in server applicationhost.config configuration file and in application configuration file with no effect:
<configuration>
<system.web>
<httpRuntime enableVersionHeader="false" />
</system.web>
</configuration>
- Set on server level with no effect:
<configuration>
<system.webServer>
<security>
<requestFiltering removeServerHeader="true" />
</security>
</system.webServer>
</configuration>
Set the DisableServerHeader DWORD registry value to 1 and restarted IIS with no effect:
HKLM\SYSTEM\CurrentControlSet\Services\HTTP\Parameters!DisableServerHeader
Tried modifying the
Global.asax
to remove the ASPNetMVC header, but it broke the application.
I confirmed, that the changes on server level go down to the website level. I tried setting it up also manually in the web.config on the site. Same effect (none).
URL Scan is no longer available, so it is not an option. Last option seems to be to use URL Rewrite, but I would rather not use it if possible, given there are supposedly native solutions for that.
What am I doing wrong and is there something I am missing?