After updating the DNS of my subdomain from IP address (Type A) to ELB url (Cname), am getting 522 error on my subdomain while connecting from the some devices. But its working on some set of devices. I tried clearing the cache, but still facing the issue. Can some one help me to debug the issue?
NB: Its working fine while am connecting directly to the ELB url
May I ask you what is your domain name and your sub-domain?
Can you check what have you got selected under SSL tab at Cloudflare dashboard? Is it Full SSL or something other?
Moreover, have you had an SSL certificate installed at your host/origin server for your sub-domain too or only your primary domain (if so)?
You are mentioning CNAME record, and “some devices” - maybe it is due to DNS cache at the ISP’s side too after you changed/updated your DNS records? (maybe it would need some time to wait to apply changes)
Could you check and does anything chage when you switch from the to cloud for your sub-domain DNS record at Cloudflare dashboard?
Regarding error 522:
Have you allowed Cloudflare IP addresses to connect to your new host/origin?
Maybe you need to allow Cloudflare IP addresses to connect to your host/origin server: