What is the 502 Bad Gateway?
502 Bad Gateway is an error that is not only commonly found on WordPress, but also on other websites with different platforms.
The impact of this error can seriously affect your website, especially in terms of decreasing visitors.
What causes 502 Bad Gateway? The following include:
- Your browser cache
- DNS issues
- Your plugins & templates
- Error Log
In the following tutorial, we will cover what causes the 502 error and how to effectively fix it.
The Effect of the 502 Bad Gateway on the Website
How much influence does 502 Bad Gateway have on your website? Let’s look at the following reviews.
1. Damaging SEO Performance
The 502 Bad Gateway error directly affects your website’s SEO performance. The reputation of the website on search engines will fall more and more freely because potential visitors continuously fail to access the website.
2. Failure to Get Visitors and Conversions
What happens if prospective visitors continue to be faced with the 502 Bad Gateway Error page?
Of course, they feel disappointed. Some may be willing to tolerate and re-access the website. However, many also say goodbye to life.
If the website fails to get visitors, how can the conversion happen? That means the impact of the 502 Bad Gateway has a very negative impact on your website as well as your business.
Error Type 502
Before getting into how to solve errors, it’s a good idea to know the various types of 502 errors based on the notifications that are displayed:
502. That's an error
502 Bad Gateway
502 Service Temporarily Overloaded
502 Server Error: The server encountered a temporary error and could not complete your request
502 Proxy Error
HTTP Error 502 - Bad Gateway
Temporary Error (502)
Again, because this 502 error can occur on various platforms, the types also vary. So how do I fix this?
How to Fix 502 Bad Gateway Error
This error is generally caused by a problem with the server, but not infrequently it is due to a problem on the website itself.
On this occasion, we will discuss the causes and solutions to fix the 502 bad gateway so that your website can be accessed again.
1. Refresh the Website Page
The first thing you need to do when you encounter the 502 Bad Gateway error is to refresh the website page or by pressing the F5 key on the keyboard. Then, please wait for the next few minutes. The error can be caused by an overloaded server.
To check, please access your website through a different browser or private browser.
Another way to check it, you can take advantage of online tools such as downforeveryoneorjustme.com.
2. Clear Your Browser Cache
Clearing the browser cache is another way to solve the problem. You need to do this method to make sure the error that appears does not come from an error page stored in your browser.
3. Try changing browsers
When clearing the browser cache doesn’t solve the problem, try switching to another browser.
Trying to switch to incognito mode is also possible. This method can be done to determine whether the problem is in the browser itself.
4. Problems with DNS
Another cause of the 502 Bad Gateway error is a DNS problem, for example, there is a domain name
5. Try Using Other Gadgets
When the cause of the 502 Bad Gateway is not resolved, you need to try the connection using another gadget.
Whether it’s a laptop, computer, or smartphone. This method needs to be done to determine whether the problem lies in the internet connection or the gadget you are using.
6. Check the Hosting Service
The most common cause of the 502 error is usually a problem with the web hosting you are using. For example, because your website is doing too many queries.
This problem is more often experienced by shared hosting users, where there is a script that will stop requests from querying your website.
This is done to prevent the server from going down and affecting other users with the same server.
If the error is due to a problem with the web hosting you are using, we recommend that you switch to a VPS Hosting service.
not pointing to the correct IP address. Errors often occur when you move websites. Therefore, you need to wait up to the next 24 hours for it to complete.
You can also flush DNS. This method is not much different from clearing the browser cache.
7. Check Plugins and Templates
Your plugins and templates can be the source of the 502 Bad Gateway error. The script or query from your website can be stopped by the server system due to a problematic script on WordPress. So, the source of the problem is often found in plugins or templates that you install.
To overcome this, you can check by deactivating all plugins, then try to access your website again before making sure the error is still there or not.
To deactivate a plugin, please log in to the WordPress dashboard first then select the Plugins> Installed Plugins menu.
Then, put a checkmark on all plugins, select Deactivate from the dropdown menu, and click Apply. You can see the visualization of the further explanation in the image below.
If the WordPress dashboard on your WordPress hosting cannot be accessed, deactivate the plugin can be via an FTP client such as FileZilla. To deactivate a plugin, you can rename the plugins folder to something else, for example, plugins-disabled.
Next, access the plugins folder by going to the main directory of your WordPress installation, then opening the wp-content folder.
If the error does not appear, please reactivate your plugins one by one through the WordPress dashboard. Don’t forget to also rename the plugins folder that you changed earlier.
8. Temporarily Deactivate the CDN
If your website uses a CDN like Cloudflare, please deactivate it temporarily by changing the Cloudflare nameserver with your hosting nameserver.
9. Check the Error Log
If a 502 bad gateway error appears on your website after you made certain changes, then it’s most likely that the change caused the error. Viewing the error log is one way to find out.
To enable error logs on WordPress, all you have to do is add a few lines below to your wp-config.
define( 'WP_DEBUG', true ); define( 'WP_DEBUG_LOG', true ); define( 'WP_DEBUG_DISPLAY', false );
To see the entry changes that have occurred, you can access the wp-contents / debug.log file to analyze the errors that occur.
10. Contact Customer Support
This method is the last step when the 502 Bad Gateway problem is not resolved using the methods described above. Describe the chronology and when you encountered this 502 error.
Those are some ways to solve the 502 Bad Gateway on your website. As we explained earlier, these errors are usually not caused by the client-side, but because of a problem with the server.
In addition, plugins or templates with poorly coded structures can also be the main cause of the error.
If you want to add an alternative on how to overcome 502 Bad Gateway, feel free to submit it in the comments column.
Click Subscribe in the column provided to get the latest articles directly in your email inbox!