• If you are still using CentOS 7.9, it's time to convert to Alma 8 with the free centos2alma tool by Plesk or Plesk Migrator. Please let us know your experiences or concerns in this thread:
    CentOS2Alma discussion

Resolved error 502 bad gateway when nginx is enabled

fferraro87

Basic Pleskian
Hi,

yesterday night i've all my sites on my plesk with this error "502 bad gateway" from nginx.
After that i've disabled nginx everything now it works fine.

I've tried to uninstall and reinstall nginx and also i've tried to use "plesk repair web" and nothing changed.

I've this plesk installed :
Code:
Product version: Plesk Onyx 17.5.3 Update #23
    Update date: 2017/09/25 14:27
     Build date: 2017/03/17 16:00
     OS version: CentOS 7.4.1708
       Revision: 55d1b49a272f44666e1920eca8b6e4da449a38cd
   Architecture: 64-bit
Wrapper version: 1.2

what can i do?
 
If you try to search phrase "502 bad gateway nginx" in Plesk KB articles, you will see that many different reasons may cause this issue. Therefore, a simple declaration of a problem is not enough. More details are needed to reduce the number of different reasons. It would be very useful to see the messages related to this problem from the logs.
 
yeah sorry, in the nginx log i don't have strange error, instead on error log on httpd i've many lines like this :

Code:
PHP Warning:  PHP Startup: Unable to load dynamic library '/opt/plesk/php/5.6/lib64/php/modules/memcache.so' - /opt/plesk/php/5.6/lib64/php/modules/memcache.so: cannot open shared object file: No such file or directory in Unknown on line 0
maybe this can be the problem?

Thanks
 
Looks like that you have defined memcache.so php module in php5.6 config (ini file) but haven't it installed. Find this ini file with

# grep -R memcache.so /opt/plesk/php/5.6/etc/*

and comment this line in config file. After that run

# plesk bin php_handler --reread
 
Looks like that you have defined memcache.so php module in php5.6 config (ini file) but haven't it installed. Find this ini file with

# grep -R memcache.so /opt/plesk/php/5.6/etc/*

and comment this line in config file. After that run

# plesk bin php_handler --reread

i don't have any output from first command
 
Please doublecheck my command

grep -R memcache.so /opt/plesk/php/5.6/etc/*
 
Maybe you have specified memcache.so module in one of subscription's PHP settings?
 
Try to check it with

# grep -R memcache.so /var/www/vhosts/system/*
 
ok i've found one subscription with memcache enabled and i've remove this, i've restarted nginx and now it works.

Thanks
 
Back
Top