如何让我的 Rails + Carrierwave + S3 通过 https 提供图像?
现在图片来自:
http://distilleryimage1.s3.amazonaws.com/f5314e1c866911e181b812314804a181_7.jpg
我希望它来自:
https://distilleryimage1.s3.amazonaws.com/f5314e1c866911e181b812314804a181_7.jpg
编辑
事实证明,图像是从任意数量的主机提供的:
distilleryimage11.s3
, distillery.s3
, 等等...
有没有办法只设置协议?
这是我的初始化程序:
CarrierWave.configure do |config|
config.fog_credentials = {
:provider => 'AWS',
:aws_access_key_id => CONFIG['s3-key'],
:aws_secret_access_key => CONFIG['s3-secret'],
:region => 'us-east-1'
}
config.fog_directory = 'my_dir'
# config.fog_host = 'https://distilleryimage1.s3.amazonaws.com' # optional, defaults to nil
end