Magento 2 use Cloudflare CDN

Hello. I am newbie and I want to integrate my Magento 2 store to serve images through Cloudflare’s CDN. I have already set up Cloudflare with my domain and everything working fine.
My question is if separate subdomain is needed for example to serve my files through Cloudflare.

Magento gives me the option to declare an address for images separate than other files. So what I am thinking is to create a new subdomain and create cname A record in Cloudflare to this new domain.

What I should do in my server side though? I don’t use cpanel or similar. I use nginx.
Do I need to create a new domain vhost there?

No, it isn’t. As long as the domain (or subdomain) you want your images to be in is proxied by Cloudflare (make sure the :grey: is turned to :orange: for the relevant records on your DNS tab), Cloudflare will cache all static files by default, and that includes images. Keep in mind that CF caches in a different way than some other CDNs. Please see this recent post or check the documentation.

This topic was automatically closed after 30 days. New replies are no longer allowed.