//bbsmax.ikafan.com/static/L3Byb3h5L2h0dHBzL2Jsb2cuY3Nkbi5uZXQvdGF5aW55aW55dWV5dWUvYXJ0aWNsZS9kZXRhaWxzLzc4OTMyNjk3.jpg
nginx使用ngx_stream_core_module模块代理tcp长连接短连接,可以增强服务器的容灾能力
下面是一个配置信息,自己也方便记录一下
- tcp {
- timeout 1d;
- proxy_read_timeout 10d;
- proxy_send_timeout 10d;
- proxy_connect_timeout 30;
- upstream tcpend {
- server 192.168.1.55:7778;
- server 192.168.1.58:7778;
- check interval=60000 rise=2 fall=5 timeout=10000 type=tcp;
- }
- server {
- server_name 192.168.1.56;
- listen 192.168.1.56:7777;
- proxy_pass tcpend;
- so_keepalive on;
- tcp_nodelay on;
- }
- }