Enable WebSocket in Cpanel Server with Nginx

On a Cpanel server, WebSocket server was running on port 8080. It worked fine with HTTP. After enabling HTTPS, it stopped working.

The website code had the following entry

This Cpanel server had ea-nginx (Nginx provided by Cpanel) installed.

To fix the error, I created a file

In the above, replace domain.com with the actual domain name.

Add following content

Create file

Replace CPANEL_USER with the actual Cpanel user name for the website. domain.com with real domain name,

Add following

Restart nginx

In your application code, find

Replace with

See Cpanel Server

Need help with Linux Server or WordPress? We can help!

Leave a Reply

Your email address will not be published. Required fields are marked *