Kingsley
Silver Pleskian
I had been encountering the issue for a week (I guess). Every morning I was waking up to 502 bad gateway for all domains and their subdomains. I was disabling and and then enabling the domains/subdomains for them to work again.
I am using Plesk Onyx as a trial on two identical servers (for testing purposes). Both have Plesk Firewall, mod_security (with comodo rules) and fail2ban enabled + one has mod_evasive enabled.
the suggestions in the https://talk.plesk.com/threads/502-bad-gateway-on-all-domains.339677/page-3#post-812512 resolved the issue for me. (I also added servers' own IPs to whitelist of fail2ban, additionally. Not sure if this is also a configuration for the issue to be solved.
thanks.
Are you using Ubuntu?