1. 程式人生 > >nginx四層代理日誌配置

nginx四層代理日誌配置

代理 pre ror session status con bytes war add

配置在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 ;
error_log  /var/log/nginx/tcp-error.log warn ;

nginx四層代理日誌配置