502 error after activate cloudflare

Hello everyone .
When i activate cloudflare on my website sometimes it shows 502 bad gateway error ,toomany redirect erro or site is loading for many minutes
Im using server that uses nginx as a reverse proxy
Now im pause cloudflare for my account but i really want enable it
Thank you

May I ask have you tried checking with the steps from below article?


Therefore, have you checked your access or error log at your origin host/server for any clue?

Is your Nginx working over HTTP or HTTPS?

Nevertheless, over what port does it work?
Maybe you need to re-check over which port is your application / web server working, as it has to be compatible and supported by Cloudflare as follows in the below article:

If it’s working over HTTPS, do you have a valid SSL certificate installed which covers both your main non-www domain and www domain?

Furthermore, what SSL option have you got at SSL/TLS tab at Cloudflare dashboard for your domain? (Flexible, Full, Strict SSL …)

May I also ask, is Cloudflare allowed to connect to your host origin?
Kindly, re-check from below article:

Cloudflare IP address ranges can be found here:

What happens when it’s enabled and the DNS records are :orange: cloud (Proxied via Cloudflare)?

sitelanka.com. IN A
sitelanka.com. 299 IN A

I don’t get a 502 error but you should contact your hosting provider to troubleshoot these common causes at your origin web server:
Basically, follow the steps below

  1. Ensure the origin server responds to requests for the hostname and domain within the visitor’s URL that generated the 502 or 504 error.
  2. Investigate excessive server loads, crashes, or network failures.
  3. Identify applications or services that timed out or were blocked.

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.