强制 Cloudinary URL 使用 HTTPS

Force Cloudinary URLs to use HTTPS

我想弄清楚如何强制 Cloudinary 在 Keystone 中使用 HTTPS。

尝试在实际 post.hbs 页面中使用 {{cloudinaryUrl image width=500 height=500 crop=‘fill’ secure=‘true’}} 但没有成功。

我看到有人提到过这个,但无法弄清楚此人指的是哪个文件。

如果你在 http 中提供你的页面,但你想强制 cloudinary 到 https,你可以在 keystone.init 函数中设置选项:'cloudinary secure': true,

此选项映射到描述的云选项 here

keystone.init({
    'name': 'xyz',
    ...
    'cloudinary secure': true,
    ....

当您像这样打印 src 图像时,打开此选项会将协议从 http 更改为 https:

src=post._.image.src({dpr:'auto'}) // pug syntax