Instructions to fix error "502 Bad Gateway nginx"
When using WordPress , you won't avoid many errors. In particular, the "502 Bad Gateway nginx" error causes your website to only display a white screen with the words ""502 Bad Gateway nginx"" which is extremely annoying to you and your visitors. Do not worry! In this article, Tino Group will guide you how to fix the "502 Bad Gateway nginx" error quickly and simply!
Learn about the “502 Bad Gateway nginx” error
What is the “502 Bad Gateway nginx” error?
The “502 Bad Gateway nginx” error occurs when the web server has received your request, but for some reason, the server cannot send you a valid response. There are many reasons why the server cannot respond to you such as:
A certain Proxy port can't work
Web server is temporarily overloaded
Your web server has a problem
Firewall – Firewall blocks server communication or blocks requests from CDN
Some errors due to network, cache or browser
If the server takes too long to process the request, the “502 Bad Gateway nginx” error may also appear.
In some cases, the Hosting service provider has problems such as being hacked or the website is down in mass, and will also leave you with a plain white screen like in the picture.
Common “502 Bad Gateway nginx” error messages
“502 Bad Gateway” – This is the most common error message when a 502 error occurs.
“Error 502”
“HTTP Error 502 – Bad Gateway”
“502 Service Temporarily Overloaded” – In this case, the server is temporarily overloaded, you can try to access it again in a few minutes
“502 Proxy Error”
“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 – This happens if you use Cloudflare for your website.
Bad Gateway: The proxy server received an invalid response from an upstream server
In some cases, the “502 Bad Gateway nginx” error shows nothing but a blank white screen.
How to fix "502 Bad Gateway nginx" error effectively
For fixing the "502 Bad Gateway nginx" error effectively, Tino Group will be divided into 2 main groups of objects including:
People visit a website and get an error
Website owner (e.g. using the WordPress platform)
Depending on the situation you are facing, you can choose the appropriate way to avoid wasting time!
3 ways to fix the common "502 Bad Gateway nginx" error
Reload the page
One of the methods that is almost always effective in solutions to technology-related problems is restart-reload .
You can also fix the “502 Bad Gateway nginx” error by reloading:
Website you are on in a few minutes
Restart the browser
Restart Windows
If you can solve the problem with this solution, congratulations! You will not have to use the "troublesome" methods as below to fix the "502 Bad Gateway nginx" error.
Use another browser
Another simple and quite effective method is to change the browser you are using. If you use Chrome browser, you can try switching to Coc Coc, Opera, Brave , DuckgoDuck, Firefox, etc.
Clear browser cache
Another fairly simple method for you to do is to clear browser cookies.
Step 1: access clearBrowserData on the browser, you can do 1 of 2 ways:
Use the key combination: Ctrl + Shift + Delete .
If you can't do the above, you can: click the 3 vertical dots on the URL bar => More Tools => Clear browsing data/Clear browsing data .
Step 2: in the Clear browsing data window / delete browser data, click on all checkboxes => delete all.
Step 3: Restart the browser and access the website again.
Using another device
If you think your device is the cause of the “502 Bad Gateway nginx” error, you can use another device to access the website.
For example, on a computer you cannot access website X, you can use your smartphone to try to access the website.
Sometimes the problem can be solved! If not, you can visit another website to view the content because it is very likely that the error is caused by the website's server.
How to fix “502 Bad Gateway nginx” error on your WordPress website
Check Plugins
If you are using WordPress and you can still access the website management interface, it is possible that the error is caused by a conflict between the Plugins on your website.
To solve it, do the following steps:
Step 1: access the Plugin management interface => select all Plugins => Deactivate.
Step 2: You try to check if your website can be accessed normally or not.
If successful : you re-enable each Plugin to see which Plugin caused the error. You can choose to delete or keep the Deactivate status for that Plugin.
If not successful. The cause of the error may be the website's server or other reasons and we must continue to experiment.
Check out the CDN
If you use Cloudflare's CDN service, what you can do is:
Disable Cloudflare's CDN service. Note: this can take hours to complete.
Contact Cloudflare fees for resolution support. If you use a Cloudflare CDN service provided by a 3rd party, you should contact them immediately to resolve the “502 Bad Gateway nginx” error.
However, you see the "Error 502 Bad Gateway" error as shown in the image, this error condition is not caused by the Cloudflare service . This error belongs to the Hosting side and the Hosting provider will be responsible for solving.
Check Hosting
There are many reasons leading to the error of Hosting. The most obvious sign of an error caused by Hosting / Hosting provider is that you cannot access your website and the website management page.
In the worse case, you cannot access the website to manage your website server.
When you encounter the "502 Bad Gateway nginx" error caused by Hosting, you can solve it by the following ways:
Wait a few minutes – a few hours for the Hosting provider to finish restoring and you can access normally.
Immediately contact the Hosting provider so that they can solve it as quickly as possible for you. If your website has a lot of traffic, website downtime for a few hours will lead to a direct decrease in income!
Hopefully, you have been able to solve the "502 Bad Gateway nginx" error without having to contact your Hosting provider. Or the case of errors caused by Hosting will also be resolved quickly. Hope you fix the "502 Bad Gateway nginx" error successfully!
How does "502 Bad Gateway nginx" error affect web SEO?
Yes. If for a long time over 6 hours, Google will consider this 502 error as a serious error and need to be resolved quickly. Otherwise, your website may be "reviewed" by Google for its ranking!
Is there any other method to solve "502 Bad Gateway nginx" error?
If you are still facing the "502 Bad Gateway nginx" error and the Hosting provider has not resolved it and you still can access your server. You can use the command to restart your nginx and PHP-FPM using FTP method:
service nginx restart
service php-fpm restart
What are the common errors on WordPress?
WordPress is an extremely popular, powerful and easy to use website building platform. However, you will still encounter a lot of errors while using WordPress. You can follow the article: 10 most common errors in WordPress and how to fix it !
Why should I find the cause of the "502 Bad Gateway nginx" error?
As mentioned in the article, if the "502 Bad Gateway nginx" error occurs for a long time, it will affect SEO. Therefore, you need to find the cause and fix it as soon as possible to avoid affecting the ranking of the website you have spent a lot of time and money to be able to rank up.