I recently created a CDN at StackPath. Everything works well, it serves files via a subdomain I created (cdn.mysite.com), which was created as a CNAME for the main site (CDN being the CNAME). However, while everything works well...I only need the CDN to serve the static files (images, css/js etc). The problem is, when I enter cdn.mysite.com in any browser, it shows the site www.mysite.com. To avoid duplicate issues with Google, I added a rel canonical to every page. Problem is, I've noticed that Google started to index some links as cdn.mysite.com instead of mysite.com.
Long story short, I don't want cdn.mysite.com to show as my site, but just to serve the static content, as I planned. I tried to restrict it from Apache, but it doesn't seem to work. Stackpath was "kind" enough to offer me a paid support tier for this advice, it wasn't enough that I paid for their service. Anyway, any help would be greatly appreciated.