I have a node.js application with socket.io running on an nginx server. The problem is the websocket connection gets timeouted by the nginx, 30 seconds after the connection, even though the connection doesn't remain idle for the whole time. This is my nginx.conf file;
user nginx;
worker_processes auto;
error_log /var/log/nginx/error.log;
pid /run/nginx.pid;
include /usr/share/nginx/modules/*.conf;
events {
worker_connections 1024;
}
stream {
upstream cluster {
least_conn;
server xx.xxx.xxx.xx:2157;
}
server {
listen 7000;
preread_timeout 86400s;
proxy_timeout 86400s;
proxy_pass cluster;
}
}
The nginx version is: 1.12.2