2

我的rails 4應用程序使用Amazon s3存儲區來存儲圖像。配置是相當默認與我production.rb文件看起來像這樣Rails s3存儲桶SSL

config.paperclip_defaults = { 
    :storage => :s3, 
    :s3_credentials => { 
    :bucket => ENV['S3_BUCKET_NAME'], 
    :access_key_id => ENV['AWS_ACCESS_KEY_ID'], 
    :secret_access_key => ENV['AWS_SECRET_ACCESS_KEY'] 
    } 
} 

在頁面加載時的圖像,它加載這樣的:

http://s3.amazonaws.com/themoderntrunk/designs/photos/000/000/052/large_thumbnail/product12.jpeg?1389721666 

我想爲它的前綴加載HTTPS:

https://s3.amazonaws.com/themoderntrunk/designs/photos/000/000/052/large_thumbnail/product12.jpeg?1389721666  

沒有SSL,我的應用程序越來越警告在控制檯

he page at 'https://www.themoderntrunk.com/assortments/4/designs/52-product-12' was loaded over HTTPS, but displayed insecure content from 'http://s3.amazonaws.com/themoderntrunk/designs/photos/000/000/049/grid/product9.jpg?1389721643': this content should also be loaded over HTTPS. 

授予,在我的production.rb文件中我有config.forse_ssl = true。我的應用程序也有SSL證書。

回答