After changing the CDN address for Discourse, the URLs referenced in topics still use the old address. You can resolve this by rebaking all topics.
Navigate to the installation directory /var/discourse and run the following commands in order.
./launcher enter app
rake posts:rebake