Images not showing securely connected to Amazon S3

I am creating a PDF that contains images that are stored on Amazon S3. My Rails application uses https, so the URL of the S3 image is https, which is configured in production.rb:

config.paperclip_defaults = {
  :storage => :s3,
  :s3_protocol => :https
}

The problem is that there is a security policy in the S3 bucket that only displays the image when it comes from my web domain. This works well when displaying an image in a view, because the referent is my web domain, which is white.

The problem when creating a PDF file is that it is wicked_pdftrying to get the image, but S3 does not see that it comes from my web domain and returns 403 Forbidden. So what can I do to solve this problem?

+4
source share
2 answers

Since you tagged your question with help wicked-pdf, I assume that you are using. This seems to be a known issue with some versions of this gem. A related question provides several options for resolving it.

+1
source

Source: https://habr.com/ru/post/1623732/


All Articles