当前位置: 首页 > 工具软件 > TCPproxy > 使用案例 >

2022-10-01 nginx反向代理tcp连接配置

汪天宇
2023-12-01

摘要:

记录nginx对于tcp连接的代理配置

nginx.conf配置:


worker_processes  1;

events {
    worker_connections  1024;
}


stream {
    upstream socket_proxy {
        hash $remote_addr consistent;
        server 192.168.96.128:22 weight=5 max_fails=3 fail_timeout=300s;
    }

    server {
       listen 22;
       proxy_connect_timeout 100s;
       proxy_timeout 300s;
       proxy_pass socket_proxy;
    }
} 

 类似资料: