Nginx 访问日志配置
# cat nginx.conf worker_processes1;error_loglogs/error.logerror;
events {
worker_connections1024;
}
http {
include mime.types;
default_typeapplication/octet-stream;
sendfile on;
keepalive_timeout65;
include vhosts/*.conf;
log_formatmain'$remote_addr - $remote_user [$time_local] "$request" ' # 先定义日志格式,main是日志格式的名字
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for"';
access_loglogs/access.logmain; # 使用日志格式,也可以把这一行放到想记录访问日志的虚拟主机配置文件中去
页:
[1]