Bad gateway refers to http error 502 which is mean that a server which is try to fulfill the client request received an invalid response from upstream server. It is often a network error between servers on the internet, meaning the problem wouldn’t be with your computer or internet connection. Empty or incomplete headers or response body typically caused by broken connections or server side crash can cause 502 errors if accessed via a gateway or proxy. Since it’s just a generic error, it doesn’t actually tell you the website’s exact issue.
How to Solve 502 Errors
Perform a hard-refresh in your browser. On Macs, this is done by pressing Cmd + Shift + R.
Clear your browser cache and delete cookies. Your browser may be holding on to certain files that were saved once you visited the website with a 502 error.
Change your DNS servers. If you’ve never changed them in the past you likely still have the default servers assigned to you by your ISP, try using open DNS servers such as Google’s Public DNS.
Finally, restart your computer/networking equipment. Some temporary issues with your computer and how it’s connecting to your network could be causing 502 errors, especially if you’re seeing the error on more than one website. In these cases, a restart would help.