将 Apostrophe-CMS S3 资产和附件作为 HTTPS 提供

Serving Apostrophe-CMS S3 assets & attachments as HTTPS

我正在使用 Amazon S3apostrophe-cms 中为我的静态资产和用户上传提供服务。我的网站加载了 https,但我所有的资产都以 http.

加载

我在我站点的静态子域中有一个 cloudfront 分发,但我不确定如何配置 apostrophe-cms 使用它来定位我的资产。

我相信您可以通过为 apostrophe-attachments 配置指定以下内容来实现此目的:

// in ./lib/modules/apostrophe-attachments/index.js
module.exports = {
  uploadfs: {
    https: true,
    cdn: {
      enabled: true,
      url: 'https://assets.example.com'
    }
  }
}

希望对您有所帮助!