开发者

nginx websocket upgstream module development

开发者 https://www.devze.com 2023-01-25 13:41 出处:网络
I\'m trying to get nginx to reverse proxy websocket connections so that i can host a rails application on the same port.

I'm trying to get nginx to reverse proxy websocket connections so that i can host a rails application on the same port.

Considering we neglect the 8 byte content-length handshake issue, I have a couple of questions on this topic:

  1. if i were to implement 1.1 keep-alive for current http upstream, would that allow me to use nginx as a reverse proxy for a node.js webso开发者_如何学Gocket server instance at the backend?
  2. (and i'm not sure if i understand this correctly) considering i'm implementing upstream keepalive, would that mean that every connection between client and nginx also results in a connection between nginx and the node.js backend for as long as the client is connected to the websocket? if that's the case is that in any way conflicting with nginx' way of connection handling?
  3. if 1. holds, can you give me any hints on how i would approach implementing this?

Thanks, Reza

P.s. There is an ngx-upstream-keepalive module which doesn't support http. http://mdounin.ru/hg/ngx_http_upstream_keepalive/


https://github.com/yaoweibin/nginx_tcp_proxy_module

0

精彩评论

暂无评论...
验证码 换一张
取 消