Knowledgebase

How to Proxy WebSockets (Socket.io / Live Chat) Through Nginx Print

  • 0

Keep persistent real-time WebSocket connections open behind Nginx.

Step-by-Step Instructions

  1. Pass Upgrade and Connection headers inside your Nginx location block.
  2. Increase proxy_read_timeout for long-lived connections.
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'upgrade';
proxy_read_timeout 3600s;

Pro Tip: Test WebSocket handshakes in Chrome DevTools → Network → WS tab.

Need assistance? Open a ticket in the A1 Client Area or contact our 24/7 NOC Engineering Team on WhatsApp at +1 (406) 229-9597.


Was this answer helpful?

« Back