Connection Websocket WSS through Cloudflare
My Machine 👍 

OS : Ubuntu 16 and 18 ( have two machine with different OS version )
Server : Nginx

Let me explain my problem in detail.
Check our this screenshot bellow,
![snap_shot_00404](https://user-images.githubusercontent.com/24210340/52837318-40eea780-3114-11e9-8877-860466205035.jpg)

The above screenshot  shows the websocket WSS is not connecting and provides 404 Error.
Right now, this configuration is connected through cloudflare WSS and using Nginx reverse proxy.
Chat Started in port ( 8080 ), which is allowed through firewall and here is my Nginx Configuration For Socket 👍 

location /chat {
        # prevents 502 bad gateway error
        proxy_buffers 8 32k;
        proxy_buffer_size 128k;
        proxy_pass https://chat.newchatroom.com:8080;
	proxy_http_version 1.1;        
	proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection "upgrade"; 
	proxy_set_header X-Forwarded-Host $host:$server_port;
        proxy_set_header X-Forwarded-Server $host;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;       
	proxy_read_timeout 999999999;        
	proxy_connect_timeout 10800s;
        proxy_send_timeout 10800s;   
}

- When i Connect the WSS without cloudflare TURNED ON, all works fine.

- If i Enable cloudflare for my subdomain and using the above configuration the WSS is not connecting through.

To make sure, this issue is related to NGINX configuration, i did a port change and connected to ratchet WSS without NGINX. Here is the result.

![snap_shot_00409](https://user-images.githubusercontent.com/24210340/52837471-e30e8f80-3114-11e9-8e73-555a41364a1a.jpg)

Cloudflare have certain allowed WEbSocket WSS ports to connect through them. One of the port is ( 8443 )

- In the screenshot you can see, i can connect to chat without nginx and cloudflare is turned ON.

I want to use it through 443 port to avoid exposing the port in connection and nginx can handle more connection without crashing the application. So, help me out to fix this nginx reverse proxy connection and cloudflare issue.

Note; The chat works and WSS can connect through nginx without cloudflare TURNED On. So we need a new configuration to fix this issue.