Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/amazon-web-services/12.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Amazon web services Carrierwave+;云面+;签名URL+;多桶_Amazon Web Services_Amazon S3_Carrierwave_Amazon Cloudfront - Fatal编程技术网

Amazon web services Carrierwave+;云面+;签名URL+;多桶

Amazon web services Carrierwave+;云面+;签名URL+;多桶,amazon-web-services,amazon-s3,carrierwave,amazon-cloudfront,Amazon Web Services,Amazon S3,Carrierwave,Amazon Cloudfront,我有一个Rails 5应用程序,它使用carrierwave,carrierwave aws和cloudfront签名器gems。我给了Carrierwave配置的默认bucket。我可以上传和提供内容(即用户头像等) 我有另一个上传程序,它有一个动态存储桶(即每个客户端)来隔离数据。我可以上传没有问题。问题是这些文件不会通过cloudfront提供服务(403禁止)。我怀疑基本CW配置正试图使用另一个bucket对bucket进行签名以访问文件 这是我迄今为止尝试的上传配置: def in

我有一个Rails 5应用程序,它使用
carrierwave
carrierwave aws
cloudfront签名器
gems。我给了Carrierwave配置的默认bucket。我可以上传和提供内容(即用户头像等)

我有另一个上传程序,它有一个动态存储桶(即每个客户端)来隔离数据。我可以上传没有问题。问题是这些文件不会通过cloudfront提供服务(403禁止)。我怀疑基本CW配置正试图使用另一个bucket对bucket进行签名以访问文件

这是我迄今为止尝试的上传配置:

  def initialize(*)
    super

    # https://stackoverflow.com/questions/31589872/setup-for-an-uploader-carrierwave

        self.aws_credentials = {
          region: ENV['AWS_REGION']
        }

        self.aws_bucket = Apartment::Tenant.current
        self.aws_signer = -> (unsigned_url, options) { Aws::CF::Signer.sign_url unsigned_url, options }

  end
它设置了自定义bucket,但URL似乎失败了。他们都签了名,但都返回403

我想我需要向aws签名者选项提供bucket或endpoint来实现这一点

有什么想法吗