通过nginx日志,查看网页响应时间

需求:想要知道nginx访问页面的响应时间。

操作:

在nginx.conf文件中配置log_format

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

《通过nginx日志,查看网页响应时间》

《通过nginx日志,查看网页响应时间》

awk '{print $7 "----------" $(NF-1)}' /data/wwwlogs/access_nginx.log

    原文作者:Cookie's
    原文地址: https://blog.csdn.net/Cookie_1030/article/details/120888974
    本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系博主进行删除。
点赞