使用EC2作为Cloudfront原始服务器

Amazon最近添加了将任何服务器用作Cloudfront的原始服务器的能力,从而消除了原始的仅限于S3的限制。

我的问题是,我该如何设置? AWS web-gui似乎只支持S3桶(仍然),ec2命令行工具似乎没有任何东西可以注册Cloudfront发行版。

任何想法非常感谢!

谢谢,克里斯。

您必须使用API​​来创build使用CustomOrigin(而不是S3Origin)的DistributionConfig。 有关如何在此处执行的一些文档: http : //docs.amazonwebservices.com/AmazonCloudFront/latest/APIReference/index.html?DistributionConfigDatatype.html#CustomOriginChildElements

然后,您必须使用该DistributionConfig创build分发: http : //docs.amazonwebservices.com/AmazonCloudFront/latest/APIReference/index.html?CreateDistribution.html

关于发行的更多信息可以在这里find: http : //docs.amazonwebservices.com/AmazonCloudFront/latest/DeveloperGuide/index.html?WorkingWithDistributions.html

我相信,一旦创build了分发版,您可以从AWS控制台中对其进行pipe理,但是您无法在此处创build它们。

现在,您可以通过AWS Web控制台设置自定义来源。

添加负载均衡器您的EC2,您可以select负载平衡器作为Cloudfront的起源。

http://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/CustomOriginBestPractices.html