nginx日志格式来分析网站访问速度与瓶颈
参考地址:http://www.ttlsa.com/nginx/nginx-modules-ngx_http_log_request_speed/ 查看nginx 安装模块和配置 /usr/local/nginx/sbin/nginx -V 修改nginx.conf(再http{}里面) log_format main '$remote_addr - $remote_user [$time_local] "$request" ' '$status $body_bytes_sent "$http_referer" ' '"$http_user_agent" "$http_x_forwarded_for" "$request_time"';
#如果不加这个的话 是无效的
access_log logs/access.log main; 检查nginx.conf配置文件是否正确 /usr/local/nginx/sbin/nginx -t 启动nginx /usr/local/nginx/sbin/nginx -s reload
查看
tail -f /usr/local/nginx/logs/access.log 时间在最后