We can see this issue which is happening only for proxy server(Nginx) via Websocket protocol and have to add timeout for our proxied server file(i.e. nginx.conf).
Review the configuration file we will have the following line which indicates the proxy server is using websocket protocol:
===================================================
# WebSocket support
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
===================================================
By default, the connection will be closed if the proxied server does not transmit any data within 60 seconds. This timeout can be increased with the proxy_read_timeout directive. Alternatively, the proxied server can be configured to periodically send WebSocket ping frames to reset the timeout and check if the connection is still alive.
So, we can set the timeout for our proxied server, and the syntax is mentioned below:
Syntax: proxy_read_timeout time;
Default: proxy_read_timeout 60s;
Context: http, server, location
Note: There will be a "keepalive_timeout 65" attribute in nginx.conf file, and we just have to add the proxy_read_timeout attribute below that and we will be able to set the timeout period as per our requirement.