Nginx日志记录了以下信息:
$remote_addr
$remote_user
(如果网站未加密,则显示“-”)$time_local
$request
$http_host
$status
$upstream_status
(如果使用了Nginx作为负载均衡器)$body_bytes_sent
$http_referer
$http_user_agent
$ssl_protocol
(如果使用了SSL)$ssl_cipher
(如果使用了SSL)$upstream_addr
(如果使用了Nginx作为负载均衡器)$request_time
$upstream_response_time
(如果使用了Nginx作为负载均衡器)此外,还可以通过配置log_format
来自定义日志格式,例如添加$http_x_forwarded_for
来记录客户端的真实IP地址(当Nginx作为反向代理时)。
以上信息提供了Nginx日志记录的主要字段,有助于进行日志分析和监控。