getting 502 Bad Gateway error

I have create a website for social cause for NGO on wordpress platform , it suddenly showing 502 Bad Gateway ngnix error. In past ,it had also shown the error , i go to The support forum and follow the instruction for wordpress , the error remove with in half an hour. website start working fine, later on it shown error 502 ,after refresh it get ok but now showing repeatedly . i m not understanding what to do. any one help