AWS Cloudfront 控制台中的“Origin Protocol Policy”字段在哪里?

Where is the `Origin Protocol Policy` field in the AWS Cloudfront console?

更新

一些细节:

Cloudfront 分发使用 S3 静态网站托管端点,类似于:bucket.name.s3-website-us-east-1.amazonaws.com.

这将重定向到实际网站。

根据这个 http://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/distribution-web-values-specify.html?shortFooter=true#DownloadDistValuesOriginProtocolPolicy :

Origin Protocol Policy (Amazon EC2, Elastic Load Balancing, and Other Custom Origins Only)

The protocol policy that you want CloudFront to use when fetching objects from your origin server.

Important
If your Amazon S3 bucket is configured as a website endpoint, you must specify HTTP Only. Amazon S3 doesn't support HTTPS connections in that configuration.

看来你只能拥有HTTP Only。那是对的吗?没有说指定HTTPS OnlyMatch Viewer吗?

我问是因为我看到博客似乎表明 Match Viewer 是可能的。例如

https://simonecarletti.com/blog/2016/08/redirect-domain-https-amazon-cloudfront/

https://karelledru.com/2016/06/static-site-hosting-on-S3-and-CloudFront/


This link

The value of the Origin Protocol Policy field in the CloudFront console or, 
if you're using the CloudFront API, the OriginProtocolPolicy element in the 
DistributionConfig complex type. In the CloudFront console, the options are 
HTTP Only, HTTPS Only, and Match Viewer.

但我在控制台中没有看到 Origin Protocol Policy 字段。

博客使用旧版本控制台的屏幕截图,这可能会导致您错误配置您的发行版。

源协议策略是源的属性,仅适用于自定义源,不适用于 S3 源。

但是,静态网站托管端点上的 S3 网站不是 S3 来源,而是自定义来源。 ("S3 origin" 指的是您使用存储桶的 REST 端点,而不是网站托管端点的情况。)

对于自定义来源,它会出现在来源设置中,在您从“来源”选项卡中 select 来源之后,以及在创建新的自定义来源时... 除非 您的自定义来源是 S3 网站端点。

当 CloudFront 识别出您指定了 S3 网站托管端点时,它不会显示在此上下文中没有意义的源选项...并且源协议策略不适用于 S3 网站托管端点,因为 S3 静态网站托管端点不支持 SSL 连接。 CloudFront 仍然可以接受来自浏览器的 HTTPS 连接,但 CloudFront 和 S3 之间的连接将始终使用 HTTP,对于静态网站来源。这通常不是一个值得关注的问题,原因如下:

  • 根据定义,返回的内容是静态的,因此它不应包含任何自定义或个人内容
  • S3 网站端点不支持经过身份验证的请求,因此根据定义,内容也是 public,或者至少不是真正私有的
  • CloudFront 不会(默认情况下)转发任何 headers 在它发送到 S3 的请求中识别查看者或泄露他们的凭据,例如 cookie 或用户代理字符串
  • CloudFront 和 S3 之间的流量在亚马逊拥有的全球网络上运行,而不是 public 互联网
  • CloudFront 和浏览器之间的连接仍然支持 HTTPS,所以你仍然得到一个绿色锁,浏览器和 CloudFront 交换的特定请求和响应仍然是加密的

请参阅 S3 开发人员指南中的 Website Endpoints 以获取我断言的文档,上面的网站端点不支持 HTTPS 或经过身份验证的请求,以及 REST 端点和 REST 端点之间的完整特性和功能比较网站端点。