Answer the question
In order to leave comments, you need to log in
Nginx + websocket, does it make sense to proxy?
Greetings. There is an nginx server, it accepts requests on ports 80 and 8080. At 80, it gives away statics (js application bundles). On 8080, it proxies requests to the nodejs + socket.io server (this is the application api). Trying to deal with nginx, I saw a lot of comments that it is better not to proxy websockets, because. this is just an extra load on nginx, which is better to use cluster and the node itself will handle the load well. Everything seems to be logical, but the question arises, how to balance the load if there are more than one nodejs servers? And will a constantly open websocket connection really load nginx? Please help me figure out the best way to do this.
PS: I understand that the node itself can hold a lot of connections and, perhaps, the second server is redundant. The site is being made for educational purposes, so this question.
Answer the question
In order to leave comments, you need to log in
https://www.nginx.com/blog/nginx-websockets-perfor...
I would leave nginx in front of the node.
+ you can transfer ssl to nginx
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question