简体   繁体   中英

Access to https on Amazon AWS S3 (5GB free) - Virtual Hosting

I try access to Amazon AWS S3 with https.

This link with http works: http://sc-st01.s3-website-eu-west-1.amazonaws.com/

But this not: https://sc-st01.s3-website-eu-west-1.amazonaws.com/

Is there any setting to enable it?

I use CNAME also but i think the problem is in access to https.

Thank you for any advice.

UPDATE: This refers to using S3 to host static web content.

If you are using your S3 bucket to host static web content, then HTTPS isn't supported. To quote the AWS doc , it says under the Test your website section:

Note

HTTPS access to the website is not supported.

Not very helpful. If you are interested in learning how S3 virtual hosting works, you can read more about it here .

To serve your static web content over HTTPS, you will need to set up an AWS CloudFront distribution, which is quite straight forward via the AWS Management Console. The only configurations that will require special attentions are:

  • Origin Domain Name : This should refer to the URI of your S3 bucket. In your case, it will be sc-st01.s3-website-eu-west-1.amazonaws.com
  • Viewer Protocol Policy : Default to HTTP and HTTPS Only
  • Alternate Domain Names (CNAMEs) : CNAME you set up in your DNS.
  • SSL Certificate : Either Default CloudFront Certificate or Custom SSL Certificate if you have one. Note that setting up custom SSL certificate is more involved as it needs to be uploaded to the IAM.
  • Default Root Object : The default file you want to serve when your user visits your static web site.

Once you're done with setting up the configurations, it will usually take 5 to 10 minutes for the new distribution to be fully configured and set up. Refer the Status field on the CloudFront management dashboard for progress. When ready, you will see the new Domain Name of your distribution. You should be able to access the static web content in your S3 bucket (assuming that the permissions of the content is granted to Everyone ) by navigating to the http: or https:// URL of your distribution Domain Name .

I will also recommend checking out the CloudFront pricing to ensure if you are aware of what is free, and what isn't.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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