https://blog.csdn.net/tayinyinyueyue/article/details/78932697

nginx使用ngx_stream_core_module模块代理tcp长连接短连接,可以增强服务器的容灾能力

下面是一个配置信息,自己也方便记录一下

nginx 代理tcp长连接短连接配置

 

 

  1. tcp {  
  2.     timeout 1d;  
  3.     proxy_read_timeout 10d;  
  4.     proxy_send_timeout 10d;  
  5.     proxy_connect_timeout 30;  
  6.   
  7.     upstream tcpend {  
  8.         server 192.168.1.55:7778;  
  9.         server 192.168.1.58:7778;  
  10.         check interval=60000 rise=2 fall=5 timeout=10000 type=tcp;  
  11.     }  
  12.   
  13.     server {  
  14.         server_name  192.168.1.56;  
  15.         listen 192.168.1.56:7777;  
  16.         proxy_pass tcpend;  
  17.         so_keepalive on;  
  18.         tcp_nodelay on;  
  19.     }  
  20. }  

 

nginx 代理tcp长连接短连接配置nginx 代理tcp长连接短连接配置

相关文章:

  • 2021-11-20
  • 2021-11-18
  • 2021-11-20
  • 2022-02-09
  • 2022-02-09
  • 2021-05-03
猜你喜欢
  • 2021-08-06
  • 2022-12-23
  • 2021-09-18
  • 2021-11-20
  • 2022-01-06
  • 2021-10-19
  • 2022-01-12
相关资源
相似解决方案