Facing 524 and 502 at random times

Website is throwing 524, and 502 at many instances. The site is going down at random intervals. Did try to restore the website when the site was down, but it didn’t help much. Please check chat notes for more info.