Basically there are multiple ways to do so, but with defaults, CDN should only delivers static data, not your files. If you cache some PDF, than everybody can get it from the cache if know link. There is no authorization mechanism for cache. Thats why CDN will only help you to deliver cached JS, PNGs, JPGs (I mean Menu pictures, not user private one)… Check this out: NextCloud + CDN - #7 by gas85
What you describe is kind of load balancing and sure you can use it differently based on you Location/IP. It is a bit more complicated, but fully secured. Check this out: Mirroring nextcloud and this Nextcloud Global Scale: local data and limitless scalability at commodity cost - Nextcloud