首页 > 其他分享 >stream TCP&UDP反向代理配置,设置stream 日志打印格式

stream TCP&UDP反向代理配置,设置stream 日志打印格式

时间:2023-01-10 16:14:25浏览次数:43  
标签:UDP log stream TCP proxy timeout upstream 10s

stream {

    log_format ldyhttps

            '$remote_addr|[$time_local]|$protocol|$status|$connection|$session_time|$upstream_connect_time|'

            '$upstream_addr|$upstream_bytes_sent|$upstream_bytes_received';

    resolver 10.99.252.10 10.99.254.10;

    resolver_timeout 60s;

    variables_hash_bucket_size 512;

 

    server {

        listen 25;

        access_log logs/25.stream.log  ldyhttps;

        proxy_connect_timeout 10s;

        proxy_timeout 10s;

        proxy_pass  smtp.exmail.qq.com:25;

    }

    server {

        listen 465;

        access_log logs/465.stream.log  ldyhttps;

        proxy_connect_timeout 10s;

        proxy_timeout 10s;

        proxy_pass  smtp.exmail.qq.com:465;

    }

 

    server {

        listen 443;

        access_log logs/443.stream.log  ldyhttps;

        deny 127.0.0.1;

        deny 10.99.130.202;

        allow all;

        ssl_preread on;

        proxy_pass  $ssl_preread_server_name:443;

    }

}

标签:UDP,log,stream,TCP,proxy,timeout,upstream,10s
From: https://www.cnblogs.com/xiedy001/p/17040580.html

相关文章