简体   繁体   English

禁止AWS Deployment 403

[英]AWS Deployment 403 forbidden

I'm deploying my static website via AWS, and after changing some files in my Bucket, my AWS endpoint is giving me a '403 Forbidden' error when I try and access the site. 我正在通过AWS部署静态网站,并且在更改存储桶中的某些文件后,当我尝试访问该站点时,我的AWS终端节点给我一个'403 Forbidden'错误。 Anyone have any ideas why? 有人有什么想法吗?

If I understand correctly you're deploying static web site from S3 bucket , can you make sure the permissions are added to your bucket ? 如果我理解正确,那么您正在从S3存储桶中部署静态网站 ,是否可以确保将权限添加到存储桶中

  1. Open the Amazon S3 console at https://console.aws.amazon.com/s3/ . 通过https://console.aws.amazon.com/s3/打开Amazon S3控制台。

  2. In the Buckets pane, choose your root domain bucket, choose Properties, choose Permissions, and then choose Add bucket policy to open the Bucket Policy Editor. 在“存储桶”窗格中,选择您的根域存储桶,选择“属性”,选择“权限”,然后选择“添加存储桶策略”以打开“存储桶策略编辑器”。

  3. Copy the following policy and paste it into the Bucket Policy Editor. 复制以下策略并将其粘贴到存储桶策略编辑器中。 In the Amazon Resource Name (ARN) for the resource in the "Resource" entry, replace example.com with the name of your bucket, and then choose Save. 在“资源”条目中资源的亚马逊资源名称(ARN)中,将example.com替换为存储桶的名称,然后选择保存。 This policy gives everyone permission to view any file in the example.com bucket. 这项政策授予所有人查看example.com存储桶中任何文件的权限。

     { "Version":"2012-10-17", "Statement": [{ "Sid": "Allow Public Access to All Objects", "Effect": "Allow", "Principal": "*", "Action": "s3:GetObject", "Resource": "arn:aws:s3:::example.com/*" } ] } 

Thanks Frédéric ^^^ 谢谢弗雷德里克^^^

Going to the AWS S3 console, and under 'Permissions' - it was the 'edit policy' component that was the problem. 转到AWS S3控制台的“权限”下-就是问题所在的“编辑策略”组件。

The policy I used can be found here: 我使用的策略可以在这里找到:

http://docs.aws.amazon.com/AmazonS3/latest/dev/WebsiteAccessPermissionsReqd.html http://docs.aws.amazon.com/AmazonS3/latest/dev/WebsiteAccessPermissionsReqd.html

It worked a treat! 它很好吃!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM