每个虚拟主机,可以配置access_log来记录日志信息。不同的sever可以有不同的log
access_log logs/host.access.log main
格式main。可以自定义其他格式。在http段可以自定义日志格式,例如,log_format main xxxxx 起了个别名叫做main,方便引用。
log_format compression '$remote_addr - $remote_user [$time_local] ' '"$request" $status $bytes_sent ' '"$http_referer" "$http_user_agent" "$gzip_ratio"';
系统默认使用main日志格式,并且放到了logs目录下,nginx.conf中有定义,虽然被注释掉,但是还是用的。