一个普通的日志是这样的:
111.111.111.111 222.222.222.222 - - [06/Jun/2017:02:19:00 +0900] "GET /monitor/l7check.nhn HTTP/1.1" 200 4 1222 "-" "-"
但是一些日志看起来像这样:
111.111.111.111 333.333.333.333 - - [06/Jun/2017:02:18:58 +0900] "-" 408 - 13 "-" "-"
我看不懂这个日志的意思。
为什么它只有一个“破折号”而不是“获取网址”?
是否可以在不请求 URL 的情况下登录 URL?
最佳答案
https://www.rfc-editor.org/rfc/rfc7231#section-6.5.7
6.5.7. 408 Request Timeout
The 408 (Request Timeout) status code indicates that the server did not receive a complete request message within the time that it was prepared to wait. A server SHOULD send the "close" connection option (Section 6.1 of [RFC7230]) in the response, since 408 implies that the server has decided to close the connection rather than continue waiting. If the client has an outstanding request in transit, the client MAY repeat that request on a new connection.
所以,客户端连接上了,但是没有发送任何 HTTP 请求。服务器等待,并最终关闭了连接。
关于apache - 在 apache 访问日志中只写入破折号,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44403769/