摘要:
记录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;
}
}