nginx日志打印响应时间

在http里头配置$request_time

    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';

实例

11.1.27.0 - - [23/Dec/2016:20:22:29 +0800] "GET /demo.js HTTP/1.1" 200 119206 "http://localhost/demo" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:50.0) Gecko/20100101 Firefox/50.0" "-" 0.288
    原文作者:codecraft
    原文地址: https://segmentfault.com/a/1190000007903143
    本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系博主进行删除。
点赞