title: How do i configure "ws" websocket on nginx nodejs server?
body: <p>I am currently trying to deploy my NODEJS application on a nginx debian remote server .
  It works very well in localhost.
  But I have some difficulties to make websocket work in remote nginx server.
  I use "ws" nodejs module.</p>
  
  <p>This is how i declared my websocket server side :</p>
  
  <pre><code>var WebSocket_ = require('ws');
  var wss = new WebSocket_.Server({port: 40510});
  </code></pre>
  
  <p>And this is how i opened my websocket client side :</p>
  
  <pre><code>var ws = new WebSocket('ws://localhost:40510');
  </code></pre>
  
  <p>I know i have to configure /etc/nginx/sites-available/default on my Nginx VPS :</p>
  
  <p>Do i need to add a websocket block location and define a specific proxipass ?
  If yes how ?</p>
  
  <p>Do I have to replace var "ws = new WebSocket('ws://localhost:40510');" by another instruction in my client side code ?</p>
  
  <p>Thank you in advance for your answers !</p>