title: ratchet, wss & nginx configuration
body: <p>my current nginx conf file:</p>
  
  <pre><code>server {
      listen 443 ssl default_server;
      listen [::]:80 ipv6only=on;
  
      ssl_certificate /etc/letsencrypt/live/domain/fullchain.pem;
      ssl_certificate_key /etc/letsencrypt/live/domain/privkey.pem;
  
      access_log /var/log/nginx/domain-access.log;
      error_log /var/log/nginx/domain-error.log;
  
      root /var/www/domain/public;
      index index.php index.html index.htm;
  
      server_name domain;
  
      location / {
              try_files $uri $uri/ /index.php?$query_string;
      }
  
  # PHP-FPM Configuration Nginx
      location ~ \.php$ {
              try_files $uri =404;
              fastcgi_split_path_info ^(.+\.php)(/.+)$;
              fastcgi_pass unix:/run/php-fpm/php-fpm.sock;
              fastcgi_index index.php;
              fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
              include fastcgi_params;
      }
  }
  </code></pre>
  
  <p>I want to be able to run 2 secure WebSocket servers (wss://) - one running over 8443 port and the other over 8444.
  I tried many configuration suggestions but none of them seems to work (connection timeout).</p>
  
  <p><strong>UPDATE:</strong></p>
  
  <p>I want to be able to connect to the WebSocket server like this:</p>
  
  <pre><code>conn = new ab.Session('wss://domain:8443',....)
  </code></pre>
  
  <p>Is it possible? or should I change the connection URI?</p>
  
  <p>Any advice?</p>