One potential error you may encounter when trying to access a website online is a 502 bad gateway error. You don’t know what exactly happened or why. All you know is that something’s wrong and you need to overcome it.
If you’re searching for ways to fix a 502 bad gateway error, you’ve landed in the right place. In this post, we’ll show:
- What is a 502 Bad Gateway Error?
- Common Signs of 502 Bad Gateway Error
- How to Fix a 502 Bad Gateway Error
So, if you want to figure out how to get rid of a 502 bad gateway error, keep on reading.
What is a 502 Bad Gateway Error?
A 502 Bad Gateway is an HTTP status code indicating a server error. These errors are not the visitor’s fault but suggest something is wrong on the server side. The client’s request is valid, but the server cannot generate the requested resource.
Typically, when you visit a website, your request is sent to a web server. If this server receives an invalid response from an upstream server, you’ll encounter a 502 bad gateway message.

Although the 502 error is not as common as a 500 internal server error or a 503 service unavailable error, it still disrupts access. This creates a poor user experience for your site visitors.
Common Signs of 502 Bad Gateway Error
The 502 bad gateway message can appear in various ways depending on your browser and web server.

Here are some common variations of this error to help you recognize it and find an appropriate solution:
- “502 Bad Gateway”
- “Error 502”
- “HTTP Error 502 – Bad Gateway”
- “502 Service Temporarily Overloaded”
- “502 Proxy Error”
- A blank white screen
- “502 Server Error: The server encountered a temporary error and could not complete your request”
- “HTTP 502”
- “Temporary Error (502)”
- “502. That’s an error”
- “502 bad gateway Cloudflare”
- “Bad Gateway: The proxy server received an invalid response from an upstream server”
6 Best Methods to Fix a 502 Bad Gateway Error
1. Reload the Website
The most common cause of 502 bad gateway errors is temporary network congestion. The easiest way to fix this is simply to reload the web page a few times.
To quickly resolve this issue, refresh the page by pressing F5 or Ctrl+R (Command+R on a Mac) on your keyboard, or by clicking the Refresh/Reload button in your browser.

2. Try Another Browser
Sometimes your web browser fails to connect to the web server. In this case, try using a different browser or opening the website in incognito mode.
3. Clear Your Browser’s Cache
If you’ve tried both methods above and the issue persists, it might be related to caching. Your browser might be temporarily unable to update even after the 502 error has been fixed. Clear your browser’s cache and see if that resolves the issue before attempting more complex solutions.
4. Change the DNS Servers
Sometimes, DNS issues cause 502 Bad Gateway errors when the domain doesn’t resolve to the correct IP address.
By default, your DNS server is assigned automatically by your ISP. You can temporarily switch to a public DNS server, such as Google or Cloudflare, to address this problem.
5. Check Your Plugins and Extensions
Incompatible plugins and extensions can also trigger 502 bad gateway errors. If this is the case, try deactivating all plugins and extensions from your WordPress admin area.
If the website works properly after deactivating all plugins, then one of them is causing the 502 error. Reactivate your plugins one by one to identify the problematic one.
6. Check Web Server Error Logs
Another potential cause of 502 bad gateway errors is an issue with a website update. Check the error logs to find more clues. In WordPress, you can enable error logging by adding the following lines to your wp-config.php file:
define( 'WP_DEBUG', true );
define( 'WP_DEBUG_LOG', true );
define( 'WP_DEBUG_DISPLAY', false );

All error entries will appear in the wp-contents/debug.log file. You can download, view, or edit this file to see all the errors, warnings, and notes from WordPress.

Which Methods Did You Use to Fix 502 Bad Gateway Error?
If you encounter a 502 bad gateway error, it’s important to understand what the error means, recognize its common signs, and know how to fix it. Hopefully, the six solutions we’ve provided to fix a 502 bad gateway error can help you resolve this issue effectively and quickly.