1、对nginx日志格式进行变更

    log_format  awstats  '$remote_addr - $remote_user [$time_local] "$request" '
                         '$status $body_bytes_sent "$http_referer" '
                         '"$http_user_agent" "$http_x_forwarded_for"';

2、对awstats配置文件进行变更:


#LogFormat=1         关闭默认的apache格式
LogFormat="%host %other %other %time1 %methodurl %code %bytesd %refererquot %uaquot %otherquot"

3、用awstats生成数据文件