• Please be aware: Kaspersky Anti-Virus has been deprecated
    With the upgrade to Plesk Obsidian 18.0.64, "Kaspersky Anti-Virus for Servers" will be automatically removed from the servers it is installed on. We recommend that you migrate to Sophos Anti-Virus for Servers.
  • The Horde webmail has been deprecated. Its complete removal is scheduled for April 2025. For details and recommended actions, see the Feature and Deprecation Plan.
  • We’re working on enhancing the Monitoring feature in Plesk, and we could really use your expertise! If you’re open to sharing your experiences with server and website monitoring or providing feedback, we’d love to have a one-hour online meeting with you.

Issue All my nodeJS sites having nginx 502 Error after restoring bakcup

beufreecasse

New Pleskian
Server operating system version
Ubuntu 22.04
Plesk version and microupdate number
Plesk Obsidian Web Pro Edition 18.0.58
Hello,
I'm facing a big issue with plesk and nodejs. I initially had a centos with plesk and because centos was to old i decided to migrate to ubuntu 22.$
I've made a backup of my plesk server with backup manager and I installed ubuntu on it.
Then I installed Plesk on the brand new ubuntu server and restored my backup with full system option.
EVerything was fine until i tried to do npm install. After that my app was having 502. I tried to uninstall node server feature and reinstall it but now all my node apps are having the same issue with 502 error.
When I check the nginx log I see :
19292#0: *7 connect() failed (111: Connection refused) while connecting to upstream

If someone could help me with this issue.

Thank you
 
It works, because then Apache won't need to be contacted by Nginx. The 502 gateway error comes into play when Nginx forwards a request to Apache, but does not receive a timely response from Apache. When you do all processing through Nginx only that won't happen. In order to find out why Apache is not responding, first make sure that the service apache2 is running. Then examine the error_log of the affected domain for details. One frequent cause is that PHP is set to "PHP via Nginx", but proxy mode is on, so that PHP requests are forwarded to Apache where they cannot be handled, because PHP is set to Nginx.

Your question here is whether it is safe to disable Apache. Yes, it is safe and it is probably even the better choice, because Nginx uses less resources and processes requests faster. If you do not need .htaccess rules, Nginx is the better choice.
 
Thank you for your answer, do you know how to change php config so it's not set with PHP via Nginx?
In fact in the php selection list i just have php with nginx listed
 
Thank you, I changed it but still have 502 error if proxy mode enabled and php set to apache. Also I don't have any error.log from apache so I don't know where the problem comes from.
Do you have any idea?
 
A log for Apache might need a day to show up under the subscription account. But you can check /var/www/vhosts/system/<your domain>/logs to see it there right away.
 
Back
Top