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

你可能感兴趣的:(nginx)