Error 502 usually indicates a remote problem that has nothing to do with your computer or Internet connection. This is good news, since there's nothing for you to fix, but bad news in that the error will continue until the people who control the erring server figure out they have a problem and fix it. However, depending on the source of the problem, you may be able to take steps to resolve or bypass it.
Internet Status Codes
The "HTTP" at the beginning of every URL stands for "Hypertext Transfer Protocol." HTTP provides an orderly way for your Web browser to communicate with Web servers -- the machine chatter that goes on behind the scenes of your Internet experience. As a part of HTTP, whenever your browser interacts with a server, such as when you attempt to load a Web page, the server responds with an Internet status code telling the browser how the interaction went. The most common one is code 200, a generic message meaning that everything went fine. These codes are always present, but your browser doesn't typically show them to you, unless something goes wrong. Code 404 is the best-known HTTP error code, indicating that the server couldn't find what your browser was looking for, but code 502 also shows up from time to time.
Code 502: Bad Gateway
HTTP error code 502 indicates a "bad gateway" or "bad proxy." When you visit a website, your browser doesn't necessarily communicate directly with the server that hosts the site. Often there are middleman Web servers along the way called "gateways" that route Web traffic between networks. If something goes wrong between the gateway server and another server upstream -- which could be either the destination server or another gateway server -- the status code that makes its way back to you is code 502. It's not a very informative message, telling you only that the gateway server received an invalid response. The actual problem could lie with the upstream server or with the gateway server itself.
Main Sources of 502 Errors
If you get a 502 error only for a specific website, it usually suggests a problem with the website's server. On the other hand, if you get 502 errors for all websites, it probably means that your Internet service provider is having a technical problem in your neighborhood. Give them a call to report the outage; and if you use a proxy server for privacy or to bypass access restrictions, a 502 error could indicate that the proxy server has some bad or difficult programming -- which is not uncommon. In this case, you could try going without the proxy or using a different proxy.
Steps You Can Take
Whenever you encounter a 502 error, hold down the "Ctrl" key on your keyboard and press "F5." This clears the cache for that page and downloads a completely fresh copy. You can also try loading the site in a different browser to make sure that it's not a problem with your browser itself. If these steps don't work, try rebooting your router, your modem and finally your computer. Rebooting these devices can clear up a variety of errors that lead to code 502. If you're tech-savvy, you can temporarily change your DNS server to a free public one. If the problem occurred in your DNS server, this will bypass the error. Finally, you can try to contact the website with the 502 error to report the problem.