If you are a website visitor and encounter 502 Bad Gateway error, you can also try to resolve this issue. While the primary issue is almost always the responsibility of the web developer, visitors can try the following:

Perform a full refresh in your browser. On Mac, this is done by pressing Cmd + Shift + R.
Clear your browser cache and delete cookies. Your browser may keep some files that were saved after you visited the website with a 502 error.
Restart your computer / network equipment
Change your DNS servers. If you've never changed them in the past, you probably still have the default servers assigned to you by your ISP, try using open DNS servers like Google's public DNS.