Hi @Paras Nogia ,
Based on the screenshot, the server information being disclosed is:
Server: Microsoft-HTTPAPI/2.0
This header is returned by HTTP.sys, not by the application code itself. Since the response also shows 400 Bad Request - Invalid Hostname, the request may be getting rejected before it reaches the IIS site or the ASP.NET Core API.
For this specific header, one thing worth checking is the HTTP.sys registry setting on the Windows VM. Create or update the following DWORD value:
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\HTTP\Parameters
DisableServerHeader = 1
Microsoft documents this setting in Http.sys registry settings for Windows. A value of 1 stops HTTP.sys from appending the Server header for responses generated by HTTP.sys, such as 400 and 503 responses.
You can add it from an elevated Command Prompt or PowerShell window:
reg add HKLM\SYSTEM\CurrentControlSet\Services\HTTP\Parameters /v DisableServerHeader /t REG_DWORD /d 1 /f
After making the change, restart the HTTP service and related IIS services, or reboot the VM during a maintenance window for the change to take effect.
You may also want to check why the request is returning 400 Bad Request - Invalid Hostname. This often happens when the request host name does not match the expected IIS site binding. You can check the HTTP.sys error log here:
C:\Windows\System32\LogFiles\HTTPERR\httperr.log
If the information I provided was helpful, I would greatly appreciate it if you could follow the instructions here so others with the same problem can benefit as well.