Nginx WebSocket connection to 'ws://xyz.com/' failed: Error during WebSocket handshake: Unexpected response code: 200
I have tried everything on my server but its not working can you please help me where i am doing mistake?

chat conf:
```

map $http_upgrade $connection_upgrade {
    default upgrade;
    '' close;
}

upstream localhost{
   server topdoc.ai:8383;
}

server {

    location / {
        proxy_pass http://localhost;
        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection "upgrade";
        proxy_set_header Host $host;
    }
}

```
chat-server.php:
```

<?php
use Ratchet\Server\IoServer;
use Ratchet\Http\HttpServer;
use Ratchet\WebSocket\WsServer;

require dirname(__DIR__) . '/vendor/autoload.php';
require dirname(__DIR__) . '/src/MyApp/Chat.php';

use MyApp\Chat;

$server = IoServer::factory(
    new HttpServer(
        new WsServer(
            new Chat()
        )
    )
  , 8084
);

$server->run();
```
websocket.html

conn = new WebSocket(ws://xyz.com/);