• The new Python extension is now available. It allows customers to deploy and manage WSGI-based Python applications on their websites directly from Plesk.
  • The Plesk Mobile apps for iOS and Android and the Plesk Mobile Center extension have been deprecated, and are no longer available for new installations. In Plesk Obsidian 18.0.84, the Plesk Mobile Center extension will be removed from servers during the upgrade, and the Plesk Mobile apps will lose their server management features.
  • The Social Login extension has been deprecated and will be removed in Plesk Obsidian 18.0.84. After that, it will no longer be possible to log in to Plesk with a Google, Facebook, GitHub account, or with a passkey. Plesk usernames and passwords, as well as logging in with a WebPros Account, are not affected.

Question How do you enable WebSockets for nodejs and nginx

MeekSqueek

New Pleskian
Hi Forum members,

I need to enable websockets for a nodejs application. The server is Centos 6 with Nginx and Nodejs4. I've tried to add some directives to the nginx config:

proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_http_version 1.1;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $host;
proxy_pass http://socket_nodes;

But "proxy_pass" directive is not allowed...

Any pointers would be gratefully received.

Thanks in advance.
 
Hi,

Did you find a solution for this ?
I'm facing the same problem, I didn't know the "proxy_pass" directive was not allowed,
But even if it were, how do you know where to proxy to ? ie: http://socket_nodes, where is that defined?
 
Hi,

Did you find a solution for this ?
I'm facing the same problem, I didn't know the "proxy_pass" directive was not allowed,
But even if it were, how do you know where to proxy to ? ie: http://socket_nodes, where is that defined?

I didn't find a solution to this but I did find a work around.

I turned off Proxy Mode (Nginx proxies requests to Apache. Turn off to stop using Apache.) as I had read somewhere that Apache doesn't support sockets. This causes the site to be served by nginx and passenger running within nginx and now it works a treat.

Have a go by turning off Proxy Mode in the Apache & nginx Settings page under the nginx settings area. If it works for you please add a reply to that effect. :)

Thanks

Simon.
 
Back
Top