Error Pages related to cwpsrv (panel access) only, this are not error pages for the websites!
502 Bad Gateway
Mostly this means that php-fpm is down.
To fix it run this command from the shell:
sh /scripts/restart_cwpsrv
You can also setup monitoring for cwp service to avoid any service being down.