1 fds 2017-11-14 10:23:43 +08:00 tcp 转发?一般不都用 HAProxy 么。 |
![]() | 2 rrfeng 2017-11-14 10:52:28 +08:00 ngx_stream_module |
3 safeoy 2017-11-14 10:56:30 +08:00 OpenResty 1.13.6.1 正式版刚刚发布,基于最新的 Nginx 主线版 1.13.6,包含了新的 ngx_stream_lua 模块,可以在 OpenResty 里面用 Lua 玩 TCP 服务器编程。 |
![]() | 4 mentalidade 2017-11-14 11:10:15 +08:00 https://openresty.org/cn/changelog-1013006.html 最新的 openresty 的可以支持了 |
5 jameshuazhou 2017-11-14 11:49:10 +08:00 listen xxx-tcp bind *:1234 mode tcp maxconn 50000 timeout client 600s default_backend abc_cluster backend abc_cluster mode tcp balance source timeout server 50s timeout check 5000 server node1 192.168.0.2:2234 check inter 10000 fall 2 rise 5 weight 1 server node1 192.168.0.3:3234 check inter 10000 fall 2 rise 5 weight 1 source 0.0.0.0 usesrc clientip |
![]() | 6 Joway/a> 2017-11-14 14:25:23 +08:00 stream { resolver 119.29.29.29 valid=10s; tcp_nodelay on; upstream http { server xxx.com.cn:80; } upstream https { server xxx.com.cn:443; } server { listen 80 so_keepalive=on; proxy_pass http; } server { listen 443 so_keepalive=on; proxy_pass https; } } |
7 lyf362345 2017-11-14 15:28:13 +08:00 ngx_stream_module 似乎会缓存域名的 ip, 如果 ip 变了没有重新加载配置是不会生效的, 目前在烦恼, 而且可配置项太少了 |
![]() | 8 psirnull 2017-11-14 15:32:20 +08:00 我的项目就用过。 |
![]() | 10 vZexc0m 2017-11-14 15:40:54 +08:00 如果是 websocket 参考这个 http://nginx.org/en/docs/http/websocket.html |
![]() | 11 owenliang 2017-11-14 17:15:52 +08:00 via Android http/1 只能 1:1 代理,http/2 可以多路复用 backend 链接,这是协议限制。 |
12 Lax 2017-11-14 17:22:41 +08:00 via iPad nginx 基于 stream 的 tcp 转发已经比较成熟,大部分一半业务需求都能够搞得定。 楼主有特殊功能需求的话可以联系我 |