while accessing the plesk panel we may get "502 Bad Gateway " error.
When we look the log file /var/log/sw-cp-server/error_log we could see error like following :
recv() failed (104: Connection reset by peer) while reading response header from upstream, client: 123.123.123.123, server: , request: "POST <some url>
This issue is due to small value being set for the fastcgi_buffer in the Plesk Panel configuration file for Nginx.
To solve this issue we have to increase the fastcgi_buffer size in the file etc/sw-cp-server/config . Increase size for following directives.
fastcgi_buffers 32 32k;
fastcgi_buffer_size 64k;
After editing the configuration file restart the following services:
root@hostname:~# /etc/init.d/sw-cp-server restart
root@hostname:~# /etc/init.d/sw-engine restart