F
F
FaIcon2017-08-12 13:00:46
Nginx
FaIcon, 2017-08-12 13:00:46

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

2 answer(s)
R
RidgeA, 2017-08-12
@FaIcon

https://www.nginx.com/blog/nginx-websockets-perfor...
I would leave nginx in front of the node.
+ you can transfer ssl to nginx

T
ThemeZV, 2017-08-12
@ThemeZ

I agree with RidgeA . And with GiperScriper .
I have a service, nginx gives statics, proxies web sockets and requests to python. During load testing, we had the entire load in python. Nginx didn't notice anything at all.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question