Shopify CDN

I wanna add CDN to my Shopify store, but when I replace nameservers with Cloudflare name servers. It gives 502 error on my Store. I have no idea why it happens.
Kindly guide me in this regard and tell how should I add CDN on my Shopify store.
Thank you

Well, first of all what is the domain name (to check that the configuration regarding name servers is done correctly)? Second, read the guide on here about 502 errors.

The 502/504 errors are caused by a problem connecting to an upstream server - meaning your server is trying to initiate a process and this fails to work as expected or times out. In most cases of 502 / 504 errors, back-end servers are not communicating correctly. When this happens, you will see color page with Cloudflare branding and the Error 502 Bad Gateway or Error 504 Gateway Timeout. Review this Community Tip for fixing 502 or 504 gateway errors.