We have an IIS server that hosts dozens of different websites and services. As of this morning, all sites hosted on this server are suddenly returning a Bad Request – Invalid Hostname response when they are accessed via IP address.
When sites are accessed via a hostname (localhost or through an SSL offloader/Web Application Firewall with the host header passed).
In IIS all sites are configured to listen http with IP address All Unassigned and a custom port with the Host name blank.
The server did reboot to apply a windows update this morning (KB5048661) but that update does not appear to impact IIS, multiple other servers in our environment have it applied without seeing the same issue, and rolling back the update did not resolve the issue so I’m not thinking that’s the source.
We’ve attempted to recreate a site from scratch and still receive the Invalid Hostname error.
The httperr log is dutifully reporting the 400 Hostname responses:
2024-12-24 13:54:13 172.x.x.x 52900 172.x.x.x 18161 HTTP/1.1 POST /xxxx – 400 – Hostname W3SvcInspection
but I’m not sure where to get more information on why or what it’s trying to match.
I’ve tried comparing configurations between this server and other servers in the same environment but cannot see any difference and am stuck trying to troubleshoot further on why IIS is returning this error suddenly.
More from the httperr log:
2024-12-24 09:15:37 172.16.33.16 54707 172.16.33.16 18090 - - - - - - Timer_ConnectionIdle -
2024-12-24 09:16:42 172.16.33.16 54731 172.16.33.16 18245 - - - - - - Timer_ConnectionIdle -
2024-12-24 09:25:45 172.16.33.16 54819 172.16.33.16 18090 - - - - - - Timer_ConnectionIdle -
#Software: Microsoft HTTP API 2.0
#Version: 1.0
#Date: 2024-12-24 09:40:13
#Fields: date time c-ip c-port s-ip s-port cs-version cs-method cs-uri streamid sc-status s-siteid s-reason s-queuename
2024-12-24 09:40:13 172.16.33.16 49756 172.16.33.16 18041 HTTP/1.1 POST /CoreWHWS.asmx - 400 - Hostname W3SvcInspection
2024-12-24 09:40:14 172.16.33.1 55206 172.16.33.16 18246 HTTP/1.1 GET /WebKiosk/Number614086 - 400 - Hostname W3SvcInspection
2024-12-24 09:40:23 172.16.33.1 55274 172.16.33.16 18246 HTTP/1.1 GET /WebKiosk/Number614086 - 400 - Hostname W3SvcInspection
2024-12-24 09:40:30 172.16.33.1 55308 172.16.33.16 18246 HTTP/1.1 GET /WebKiosk/Number614086 - 400 - Hostname W3SvcInspection
And just to confirm:
The following URL works fine: http://localhost:18041/CoreWHWS.asmx
The following URLs return an invalid hostname: http://127.0.0.1:18041/CoreWHWS.asmx
http://172.16.33.16:18041/CoreWHWS.asmx
The bindings are set to All Unassigned IPs with the hostname field blank. This is happening with every single site hosted on this server, so appears to be some sort of IIS wide issue versus a specific binding issue.
2