【问题标题】:Force Cloudinary URLs to use HTTPS强制 Cloudinary URL 使用 HTTPS
【发布时间】:2019-01-23 20:36:36
【问题描述】:

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

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

我看到有人提到过这个,但不知道这个人指的是哪个文件。

【问题讨论】:

    标签: https cloudinary keystonejs


    【解决方案1】:

    如果您在 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
    

    【讨论】:

    • 正确,这就是我最终做的。 'wysiwyg cloudinary images': true, 'cloudinary secure':true
    猜你喜欢
    • 2018-07-08
    • 2012-02-24
    • 2015-06-22
    • 2011-03-19
    • 2018-03-18
    • 2016-05-14
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多