My CentOS 7 + CWP panel configured as:
Nginx & Apache Additional Options: php-cgi/suphp, nginx/php-fpm, apache/php-fpm, proxy HTTP: Nginx (80) --> Apache (8181) HTTPS: Nginx (443) --> Apache (8181)
I want to run a WebSocket application that using localhost address 0.0.0.0:8282 for communication So I have put a cron job to run my chatserver WebSocket app on each server boot using a command:
PHP index.php chatserver server
In the SSH console I can see that the server run without any issues:
Running server on host 0.0.0.0:8282
But in the browser client side I can see an error like that:
WebSocket connection to 'wss://.:8282/?' failed: Error in connection establishment: net::ERR_CONNECTION_REFUSED socket.js?v=:** WebSocket connection to 'wss://.:8282/?***' failed: Error in connection establishment: net::ERR_CONNECTION_REFUSED
Looks like Nginx doesn't let to pass the socket connection on the port 8282. Could you please to help me to change the Nginx configuration file of the specific domain that works over SSL to successfully establish WebSocket connection to the port 8282 and connected to my localhost chatserver. I will appreciate any help.