HTTPS的Amazon S3的静态网站静态、网站、HTTPS、Amazon

2023-09-11 08:18:15 作者:∞ 情人十六

我想举办使用Amazon S3和CloudFront的一个HTTPS,只有静态的网站。这是我到目前为止,完成的:

设置了一个S3存储静态网站托管,并把我的网站文件在里面 创建一个CloudFront的分布,并指出它的S3存储 加在我的域名的域名服务器的 WWW 子域名指向CloudFront的斗CNAME记录。

到目前为止,一切都很好 - 我可以使用 www.example.com 地址来访问我的网站。但是,我希望自己的网站通过HTTPS只,为此,我买了GoDaddy的SSL证书是可用的。

现在的问题是:

有没有办法在我的S3托管的网站上安装这些第三方SSL证书? 有没有办法有一个自动HTTP到HTTPS重定向与此设置? 解决方案

是的,从今天开始,你可以免费做。

您现在可以在CloudFront的使用HTTPS使用的CNAME,因为它现在使用的服务器名称指示(SNI)支持自定义SSL证书:http://aws.typepad.com/aws/2014/03/server-name-indication-sni-and-http-redirection-for-amazon-cloudfront.html

我设法建立一个免费的1级startssl如果证书为我的CloudFront的分布静态网站在S3上没有太多的麻烦(参见:CloudFront通过HTTPS服务使用SNI )发生错误。

亚马逊s3的使用方法 使用Amazon S3 –第一部分

I want to host a HTTPS-only static website using Amazon S3 and CloudFront. Here's what I've done so far:

Set up an S3 bucket for static website hosting and put my website files in it Created a CloudFront distribution and pointed it to the S3 bucket Added a CNAME record in my domain's nameservers for the www subdomain pointing to the CloudFront bucket.

So far, so good - I can access my website using the www.example.com address. However, I want the site to be available via HTTPS only, for which I bought an SSL certificate from GoDaddy.

Now, the question is:

Is there a way to install this third-party SSL certificate on my S3-hosted website? Is there a way to have an automatic http to https redirect with this setup?

解决方案

Yes, as of today you can do it at no charge.

You can now use HTTPS with CNAMEs on CloudFront as it now supports custom SSL certificates using Server Name Indication (SNI): http://aws.typepad.com/aws/2014/03/server-name-indication-sni-and-http-redirection-for-amazon-cloudfront.html

I managed to set up a free Class 1 StartSSL cert for my CloudFront distributed static site on S3 without too much trouble (see: CloudFront error when serving over HTTPS using SNI).