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?
On my site, S3 parameters were set on the panels, not in the app.yml.
Did you run the rake task to precompile assets and push to S3?
As described in
Set up file and image uploads to S3
I have configured relevant settings on admin panel, but I need to modify the app.yml and then rebuild app? I know how to do it but it seems risky.
You can run the rake task without rebuilding like this:
./launcher enter app
rake assets:precompile rake s3:upload_assets
Thank you very much!
I did as you said, but my website has broken. The uploaded assets are *.gz.js which have encoding problems.
It is called qiniu which is a Chinese cloud service provider.
The problem is caused by cdn?
here is my setting:
## S3 storage
Do you get the same file with the same headers if you use the CDN as you do when you get the asset directly from the bucket?
Thanks for your patience!
I can download the file directly with such link http://qiniu.pengfeima.cn/assets/discourse-6a8036cdae750c5b30dadebc5bb6f5f3d3c205f173e19757ab47eb6314c9d8ec.gz.js. It is the same file used in the browser, which is downloaded with cdn.
I think there is some problems during upload assets(only photos are correct). I won’t use cdn for assets anymore.