I have an application which serves assets under the following URL:
https://example.com/assets/...
Now I want to use Amazon CloudFront to serve these assets with the URL
https://cdn.example.com/assets/...
The things I have done:
- I created a new distribution with the origin of
cdn.example.com - I added a
CNAMEDNS record pointingcdn.example.comtoexample.com
Now I feel like that configuration does not serve the assets via CloudFront. Instead if I request my CloudFront Domain Name, lets say dpw02sdffky7p.cloudfront.net, I get redirected to example.com. So it feels like my assets are still being served from my server, just with some redirects in between.
Am I right? What would be the correct configuration to achieve my goal?