简体   繁体   English

将Amazon S3存储桶和Cloudfront与SSL Wordpress网站一起使用不会提供静态文件

[英]Using Amazon S3 bucket and Cloudfront with an SSL Wordpress site doesn't serve the static files

I have an ecommerce site running Wordpress with Divi Theme, and my site has its own SSL certificate. 我有一个运行带有Divi Theme的Wordpress的电子商务网站,并且我的网站有自己的SSL证书。

I recently signed up for Amazon S3 and Cloudfront, and installed W3 Total Cache on my site. 我最近注册了Amazon S3和Cloudfront,并在我的网站上安装了W3 Total Cache。 I've followed the online tutorials, and uploaded my site contents to my S3 bucket. 我遵循了在线教程,并将网站内容上传到S3存储桶。 However, when I click the option to use the CDN for my static files, the images on my site are not shown, and the theme goes a little wonky. 但是,当我单击将CDN用于我的静态文件的选项时,我的站点上的图像没有显示,并且主题有点不清晰。 I'm wondering if this is because my images are hosted in an 'https://' address? 我想知道是否是因为我的图像托管在“ https://”地址中? Would adding my SSL certificate to Cloudfront sort this, or is it something else? 可以将我的SSL证书添加到Cloudfront进行排序,还是其他? Any help on this one would be amazing. 任何对此的帮助将是惊人的。

If you want users of you site to reference the name of images and content by https://example.com/images/image1.jpeg then yes you have to upload your cert to Cloudfront. 如果您希望站点的用户通过https://example.com/images/image1.jpeg引用图像和内容的名称,则必须将证书上传到Cloudfront。 otherwise you need to to reference them by the distrubution id, https://d111111abcdef8.cloudfront.net/images/image1.jpeg . 否则,您需要通过发布ID https://d111111abcdef8.cloudfront.net/images/image1.jpeg引用它们。

Requirements for a SSL cert on Cloudfront Cloudfront上SSL证书的要求

SSL between Cloudfront and S3 Cloudfront和S3之间的SSL

Note the following about using HTTPS when the origin is an Amazon S3 bucket: 请注意以下有关在源是Amazon S3存储桶时使用HTTPS的信息:

If your Amazon S3 bucket is configured as a website endpoint, you can't configure CloudFront to use HTTPS to communicate with your origin because Amazon S3 doesn't support HTTPS connections in that configuration. 如果您将Amazon S3存储桶配置为网站终端节点,则无法将CloudFront配置为使用HTTPS与您的来源进行通信,因为Amazon S3在该配置中不支持HTTPS连接。

Amazon S3 provides the SSL/TLS certificate, so you don't have to. Amazon S3提供了SSL / TLS证书,因此您不必这样做。

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

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