• Our team is looking to connect with folks who use email services provided by Plesk, or a premium service. If you'd like to be part of the discovery process and share your experiences, we invite you to complete this short screening survey. If your responses match the persona we are looking for, you'll receive a link to schedule a call at your convenience. We look forward to hearing from you!
  • The BIND DNS server has already been deprecated and removed from Plesk for Windows.
    If a Plesk for Windows server is still using BIND, the upgrade to Plesk Obsidian 18.0.70 will be unavailable until the administrator switches the DNS server to Microsoft DNS. We strongly recommend transitioning to Microsoft DNS within the next 6 weeks, before the Plesk 18.0.70 release.
  • The Horde component is removed from Plesk Installer. We recommend switching to another webmail software supported in Plesk.

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