What is error 502 bad gateway?

Error 502 Bad Gateway

Error 502 Bad Gateway can occur anytime. It means the connection failure in between your Host server and your website.

Moreover, your Host server can’t identify the data that is requested by any visitor of your website. Thus, it’s known as 502 (bad gateway) error.

Error 502 bad gateway generally occurs when you use any CDN service. CDN means Content Delivery Network.

If you are using Cloudflare free CDN service you can notice such kind of error. That’s why it’s told not to use any free CDN service. It can be dangerous for your website.

Cloudflare Error On WordPress Website:

Suppose, you are using Cloudflare free CDN service to excel your website speed and secure it. It sounds good. Right?

Not at all. As soon as you connect free Cloudflare CDN with your WordPress website you will face error 502 (bad gateway).

There are two types of 502 error occurred by using free Cloudflare CDN service:-

First is you will see on your mobile screen or desktop screen as the below image shows.

502 Bad Gateway

In this case, the problem is on the Cloudflare. You can’t do anything for it.

We’ll discuss here on the second type of error 502 occurred from Cloudflare.

After connecting your WordPress website with free Cloudflare CDN, you might face this problem after some days or after that day. Read Also Why SiteGround is the best for Hosting?

When you will try to open the home page of your website you can face this problem. Even if you go to open any blog post from your site, error 502 bad gateway will come to your screen.

In the above image shows how it looks like when it comes to your screen.

For this bad gateway error, you can’t even visit your home page of your site. Can you imagine that?

Okay! Don’t worry. This error can be fixable. If you are so unlucky only then it can’t be fixed.

How to fix error 502 bad gateway from Cloudflare in WordPress?

Actually this is not the problem of Cloudflare. It occurs because of configuration problem (502 bad gateway dns error) from clouflare to your domain server. Or it can be occurred because of MX records of your Cloudflare.

The steps to fix the above problems (502 bad gateway error message solution) :-

  • Go to your Cloudflare account.
  • Click on the particular domain name.
  • Check your dashboard.
  • Check your configuration.

If it’s showing “Cloudflare is active” just relax. Your Cloudflare is okay.

Now, you can check your domain name server in your domain provider.

If it’s GoDaddy from which you have purchased your domain name,

  • Go to your GoDaddy account.
  • Sign in there.
  • Visit your product details.
  • Click on the particular domain name.
  • Visit your DNS (Domain Name Server).
  • Check the server names (There should be two name servers provided by Cloudflare).

Still the problem is coming? Don’t worry. It’s fixable.

  • Go to your particular issue page/post.
  • Refresh the tab.
  • Wait for a few seconds.

If it’s not fixed,

  • Go to your chrome setting.
  • Scroll down.
  • Click on advance.
  • Clear cookies.
  • Refresh it.


  • Go to your website dashboard.
  • Clear the cache files and cookies.


Try to open the issue page/post. You will get it solved.


Please enter your comment!
Please enter your name here