Nginx日志配置输出请求响应时间

修改默认nginx.conf配置文件

#修改log_format项

http {
    include       mime.types;
    default_type  application/octet-stream;

    log_format  main  '$remote_addr - $remote_user [$time_local] "$request" '
                      '$status $body_bytes_sent "$http_referer" '
                      '"$http_user_agent" "$http_x_forwarded_for"|"request_times:"$request_time';

    access_log  logs/access.log  main;
request_time
指的就是从接受用户请求的第一个字节到发送完响应数据的时间,即包括接收请求数据时间、程序响应时间、输出
响应数据时间。
posted @ 2022-06-08 09:30  RFAA  阅读(3272)  评论(0编辑  收藏  举报