In production.rb:
config.paperclip_defaults = {
s3_host_name: \"s3.#{ENV.fetch(\'AWS_REGION\')}.amazonaws.com\",
storage: :s3,
s3_credentials: {
You need to specify the scheme on paperclip
configuration as below:
config.paperclip_defaults = {
s3_host_name: "s3.#{ENV.fetch('AWS_REGION')}.amazonaws.com",
storage: :s3,
:s3_protocol => :https, # <- added this
s3_credentials: {
bucket: ENV.fetch('S3_BUCKET_NAME'),
access_key_id: ENV.fetch('AWS_ACCESS_KEY_ID'),
secret_access_key: ENV.fetch('AWS_SECRET_ACCESS_KEY'),
s3_region: ENV.fetch('AWS_REGION'),
}
}
:s3_protocol => :https
will assign the scheme https
to the url's generated for your amazon s3 assets. Refer to documentation for more details.