Socket.io Nginx Nodejs Connection error

I recently changed my DNS settings to Cloudflare. After this DNS update, my Nodejs program stopped working, It does not connect to my socket, I get connection timeout or 503 if I change port to be one of the cloudflare whitelisted port numbers.

Server code is listening on the port 1337 and is using HTTPS.

Client code : var io = require('socket.io-client'); var socket = io.connect("https://websitename.com:1337/", { reconnection: true });

Nginx config

server {

listen 443;

ssl on;

ssl_certificate ssl/servername.crt;

ssl_certificate_key ssl/servername.key;

server_name _;

location / {
    proxy_pass https://serverip:1337;
    proxy_http_version 1.1;
    proxy_set_header Upgrade $http_upgrade;
    proxy_set_header Connection 'upgrade';
    proxy_set_header Host $host;
    proxy_cache_bypass $http_upgrade;
 }

}

I am deeply grateful for any help.

Port 1337 is not supported by Cloudflare. Please use the search for a list if supported ports.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.