When WordPress hosting server getting an invalid response for the any request, it will immediately through trigger that is called 502 bad gateway error.
While you’re surfing website and your browser sends a request to the hosting server, the hosting server find the page and send it back to in your browser with the status code.
Most common reason for 502 bad gateway error through, your request take too long for the server to getting respond. This delay can be temporary glitch by high traffic. It could be glitch cause by a poor code in WordPress theme or plugin. Also it is happened for server misconfiguration.
Follow below steps for resolve 502 bad gateway errors
- Reload Your Website
- Clear Browser Cache
- Disable the CDN or Firewall
- Update WordPress Themes and Plugins
- Check the Hosting Server
Reload your website
In general cases, your server may take long respond due to heavy traffic on your side or low server resources. In that case the problem may automatically disappear in a few minutes. You should have to try again and reload your web page.
Clear Browser Cache
If any cache storage plugins in your website, then you should have to clear your cache. Even after the issue is fixed but errors comes from the cache.
Disable the CDN or Firewall
If you are using a CDN service or website firewall on your website, then it is possible that their servers are acting up. To check this, you will need to temporarily disable CDN.
Once disabled, it will remove the additional layer that has been created between your browser and the hosting server. Your website will now load entirely from your server and if the issue was caused by the CDN / firewall service, then it will get resolved now.
You can then contact your CDN service provider for support. Once the issue is resolved, you can go ahead and enable the CDN again.