Nginx proxy Websocket parameters that need attention

Nginx proxy Websocket parameters that need attention


The Websocket provided to the outside world is basically based on the wss protocol, which is generally reversed through Nginx+SSL certificate

#Proxy Parameter

If the proxy connection and operation time waiting time are not set, the default is 5 minutes if there is no sending and pushing messages, it will be disconnected. Sometimes the vacancy period of some businesses may exceed 5 minutes. The following time parameters can be adjusted according to the business

#Parameter example

location / {
      proxy_http_version 1.1;
      proxy_set_header Upgrade $http_upgrade;
      proxy_set_header Connection "upgrade";
      proxy_read_timeout 1200s;
      proxy_connect_timeout 1200s;
      proxy_send_timeout 1200s;

#Support Author


Did you enjoyed the article ?
Subscribe to the newsletter 👨‍💻

Be the first to know when I write something new! If you don't like emails, you can follow me on GitHub.