Random 502 bad gateway

I have come across a stange issue recently. Randomly 502 error appears on website.

But when the webpage is refreshed, the 502 clears & page loads fine.

I noticed this issue during following times (randomly);

1) When trying to login via backend (couple of times)
2) When trying to update pages (came across this issue once so far )

3) I have few pdf eflyers (emailed to customers) with a link to specific pages on website. Sometimes when a link is clicked on pdf eflyer, 502 error comes.( When refreshed, page loads without 502 error )

Website is on inmotionhosting (cpanel account).

Any specific thing to look prior to checking this issue with hosting provider? Is it some issue on wordpress or plugins ?

Any help is highly appreciated.
Thank you.


This site will teach you how to build a WordPress website for beginners. We will cover everything from installing WordPress to adding pages, posts, and images to your site. You will learn how to customize your site with themes and plugins, as well as how to market your site online.

Buy WordPress Transfer