客户端 (IE) 对静态 html keep_alive 页面的请求似乎工作正常,但执行负载平衡的网络交换机在使用完全相同的 URL 时似乎无法请求同一页面。来自交换机的 HTTPERR 日志条目给出404-NotFound -
。它显然不会到达 IIS,但为什么 HTTPAPI 会拒绝它?我在哪里可以看到原因代码或错误消息,或者其他什么?请帮忙 :|
摘自 HTTPERR:网络交换机请求失败(IP 已删除)
2013-02-14 18:34:55 X.X.X.X 38676 X.X.X.X 80 HTTP/1.1 HEAD /keep_alive.html 404 - NotFound -
当交换机尝试获取页面时,此过程每隔几秒重复一次。
从我的故障排除中捕获的网络帧:
NETWORK SWITCH
- HTTP: Request, HEAD /keep_alive.html
Command: HEAD
- URI: /keep_alive.html
Location: /keep_alive.html
ProtocolVersion: HTTP/1.1
Host: X.X.X.X
Connection: Close
HeaderEnd: CRLF
- HTTP: Response, HTTP/1.1, Status: Not found, URL:
ProtocolVersion: HTTP/1.1
StatusCode: 404, Not found
Reason: Not Found
ContentLength: 315
- ContentType: text/html; charset=us-ascii
+ MediaType: text/html; charset=us-ascii
Server: Microsoft-HTTPAPI/2.0
Date: Fri, 15 Feb 2013 16:52:52 GMT
Connection: close
HeaderEnd: CRLF
DESKTOP
- HTTP: Request, GET /keep_alive.html
Command: GET
- URI: /keep_alive.html
Location: /keep_alive.html
ProtocolVersion: HTTP/1.1
Accept: application/x-ms-application, image/jpeg, application/xaml+xml, image/gif, image/pjpeg, application/x-ms-xbap, application/vnd.ms-excel, application/vnd.ms-powerpoint, application/msword, */*
Accept-Language: en-US
UserAgent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.1; WOW64; Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; .NET CLR 1.1.4322; .NET4.0C; .NET4.0E)
Accept-Encoding: gzip, deflate
Host: X.X.X.X
Connection: Keep-Alive
- Cookie: ...
- Http: Response, HTTP/1.1, Status: Ok, URL: /keep_alive.html
ProtocolVersion: HTTP/1.1
StatusCode: 200, Ok
Reason: OK
- ContentType: text/html
MediaType: text/html
ContentEncoding: gzip
Last-Modified: Fri, 26 Feb 2010 05:11:00 GMT
Accept-Ranges: bytes
ETag: "0aca15a2b6ca1:0"
Vary: Accept-Encoding
Server: Microsoft-IIS/7.5
XPoweredBy: ASP.NET
Date: Fri, 15 Feb 2013 17:15:13 GMT
ContentLength: 1514
HeaderEnd: CRLF
- payload: HttpContentType = text/html
HtmlElement: ...
答案1
找到了解决办法。
问题出在 IIS 中的绑定配置上。网络交换机根据以下条件生成请求:IP地址。在来自网络交换机的请求帧中(如上所示),您会注意到该Host
值作为 IP 地址传递。缺少适当的绑定显然只会在 HTTPERR 日志中返回此类 404。我们的 IIS 配置仅包含 DNS 名称的绑定。
总结
确保您的 IIS 绑定包含 IP 和 DNS 的条目,否则您将会遇到麻烦。