我为我的nginx服务器使用自定义日志格式,如下所示:
log_format combine '$remote_addr - $remote_user [$time_local] "$request" $http_host '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for" '
'"$upstream_addr" "$upstream_status" $upstream_cache_status "$upstream_http_content_type" "$upstream_response_time" > $request_time';
一切正常,有时我得到非常奇怪的空日志:
[13/Mar/2014:08:09:22 +0400] "-" 400 0 "-" "-"
这是什么意思?
答案 0 :(得分:0)
这是未完成的请求。可能有人连接到您的服务器但由于某种原因未能提出请求。
尝试以下命令:
telnet yousite.com 80
ctrl-c
E.g:
$ telnet localhost 2002
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
^]
telnet> Connection closed.
和我的日志:
[13/Mar/2014:11:29:54 +0400] - 127.0.0.1 "-" 400 "-" "-" "-" "-" "-" - [proxy (-) : - - ] 0 "-" 0.000