문제

I have a S3 Bucket names "cdn.myexmaple.com"

and I set Cloudflare point my site "myexample.com" DNS

CNAME cdn cdn.myexample.com.s3.amazonaws.com

how can I set my bucket policy allow Cloudflare can get bucket object?

There is a way to set S3 Bucket allow http refer like:

{
  "Version":"2012-10-17",
  "Id":"http referer policy example",
  "Statement":[
    {
      "Sid":"Allow get requests originated from www.example.com and example.com",
      "Effect":"Allow",
      "Principal":"*",
      "Action":"s3:GetObject",
      "Resource":"arn:aws:s3:::cdn.myexample.com/*",
      "Condition":{
        "StringLike":{
          "aws:Referer":[
            "http://cdn.myexample.com/*",
            "http://www.myexample.com/*"
          ]
        }
      }
    }
  ]
}

Can I set a police that allow CLoudFlare to access object?

도움이 되었습니까?

해결책

We have tips for S3 and CloudFlare already.

Everything should work fine as long as we are proxying the record in your DNS settings.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top