502 error after activate cloudflare

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