Nginx 启用stream日志

向 nginx.conf 添加如下配置

stream {
    log_format proxy '$remote_addr [$time_local] '
                 '$protocol $status $bytes_sent $bytes_received '
                 '$session_time -> $upstream_addr '
                 '$upstream_bytes_sent $upstream_bytes_received $upstream_connect_time';

    access_log /var/log/nginx/tcp-access.log proxy;
	# open_log_file_cache off;
    # include /etc/nginx/conf.d/*.stream;
}

你可能感兴趣的:(Linux,运维,nginx,服务器,linux)