As explained on nginx's website I've used these settings for my nginx to proxy websockets to a NodeJS server:
location /socket.io/ {
proxy_pass http://backend;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
}
Everything works fine and socket.emit() / socket.on() send messages to each other; until I send a rather big text message (26 kB of html).
- this big message is not received by NodeJS (so I guess that the issue is on nginx side)
- there are no error on nginx log
- once this big message has been send by the client, NodeJS will stop receiving socket.io's heartbeats from this client.
What am I doing wrong? Is there a nginx setting that I am not aware of?