title: Websocket - Nginx proxy pass 400 Bad Request
body: <p>I am setting up Websocket in nginx with SSL. This is the example code :</p>
  
  <p><strong>App code :</strong></p>
  
  <pre><code>...
  var conn = new ab.Session('wss://domain.com',
  ...
  </code></pre>
  
  <p><strong>nginx.conf :</strong></p>
  
  <pre><code>...
  server {
      charset utf-8;
      client_max_body_size 128M;
  
      #listen       80 default_server;
      listen       443 ssl;
      server_name  domain.com;
      root         /usr/share/nginx/html/dahz/web;
      index        index.php index.html index.htm;
  
      ssl_certificate      /etc/ssl/bundle.crt;
      ssl_certificate_key  /etc/ssl/domain.key;
      ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
  
      #charset koi8-r;
  
      #access_log  /var/log/nginx/host.access.log  main;
  
      # Load configuration files for the default server block.
      include /etc/nginx/default.d/*.conf;
  
      location / {
              autoindex  on;
              try_files $uri $uri/ /index.php?$args;
  
              proxy_pass http://localhost:8080;
              proxy_http_version 1.1;
              proxy_set_header Upgrade $http_upgrade;
              proxy_set_header Connection "upgrade";
  
       }
  ...
  </code></pre>
  
  <p>Until this step, the Websocket has been connected to the server. but where i try to access <a href="https://domain.com" rel="nofollow">https://domain.com</a> eventhough i have been able to access <a href="https://domain.com/index.html" rel="nofollow">https://domain.com/index.html</a>. there are some 400 error on asset. 
  how do i fix the 400 error ?</p>