The s3 cdn url setting makes no effect on non-image files. shaoyaoqian reports that the s3 cdn url is replaced by the endpoint url for uploaded files.
shaoyaoqian configured the S3 parameters on the admin panel but needed to modify the app.yml and rebuild the app to resolve the issue. pfaffman suggested running the rake task to precompile assets and push to S3 without rebuilding the app, but this caused encoding problems with gzipped assets.
shaoyaoqian is using the Chinese cloud service provider Qiniu and provided their S3 settings. pfaffman asked if the CDN was causing the problem, and shaoyaoqian confirmed that the asset downloaded directly from the CDN was the same as the one used in the browser.
Ultimately, shaoyaoqian decided not to use the CDN for assets due to issues with uploading non-image files.
The s3 cdn url setting works well for photos but it makes no effect for other kinds of files. It appears that the s3 cdn url was replaced by the endpoint url for uploaded files.
for example, my s3 cdn url is http://qiniu.pengfeima.cn, my s3 endpoint url is http://qiniu-s3.s3-ap-southeast-1.qiniucs.com. When I click the short url on discourse, it links to http://qiniu-s3.s3-ap-southeast-1.qiniucs.com/original/2X/e/effbf521dc7f117e7d9b57ed41b2cac576bf39d5.txt, but the correct url should use cdn url rather than endpoint url.
How can I solve this problem?
PS
On my site, S3 parameters were set on the panels, not in the app.yml.