拒绝访问错误与Amazon S3错误、Amazon

由网友(清瑟)分享简介:我收到拒绝访问错误与Amazon S3和想不通这是为什么。I'm getting an Access Denied error with Amazon S3 and can't figure out why.我的设置如下:STATIC_URL ='http://s3.amazonaws.com/%s/'%AWS_S...

我收到拒绝访问错误与Amazon S3和想不通这是为什么。

I'm getting an Access Denied error with Amazon S3 and can't figure out why.

我的设置如下:

STATIC_URL ='http://s3.amazonaws.com/%s/'%AWS_STORAG​​E_BUCKET_NAME

什么会导致拒绝访问错误?我已经验证了我的钥匙是正确的。

What would cause an access denied error? I have verified that my keys are correct.

推荐答案

你上面显示的URL将解析为在S3桶。为了成功地访问桶这样的URL,放在桶里的权限将有权授予公共读访问桶。此外,铲斗内的每个对象或文件将具有授予'公共读的访问,以及

The URL you show above would resolve to a bucket within S3. In order to access that bucket successfully with such a URL, the permissions on the bucket would have to grant 'public-read' access to the bucket. In addition, each object or file within the bucket would have to grant 'public-read' access, as well.

你想的桶和桶中的所有内容被任何人是可读的?如果是这样,请确保权限正确设置。但是请注意,这给予公共读到桶本身将允许任何人以列出桶的内容。这通常是不必要的,而且也应该避免。

Do you want the bucket and all content within the bucket to be readable by anyone? If so, make sure the permissions are set appropriately. Note, however, that granting 'public-read' to the bucket itself will allow anyone to list the contents of the bucket. That's usually unnecessary and probably should be avoided.

另外请注意,键(我假设你的意思是你的AWS访问密钥和秘密密钥),只有当您通过API访问S3适用。如果你只是通过浏览器访问的URL,凭据不会在请求中使用。

Also note that the keys (I assume you mean your AWS access key and secret key) only apply when you are accessing S3 via the API. If you simply access it with the URL via a browser, the credentials are not used in the request.

阅读全文

相关推荐

最新文章