【问题标题】:Mixed Content problem for Plone behind Traefik reverse proxyTraefik 反向代理后的 Plone 的混合内容问题
【发布时间】:2020-03-06 20:54:12
【问题描述】:

我刚刚尝试安装基于 Docker 的 Plone,它作为反向代理在 Traefik 后面运行,但是当我从 Web 浏览器访问它时,我在控制台上收到如下错误:

混合内容:“https://new.mydomain.id/”处的页面通过 HTTPS 加载,但请求的样式表“http://fonts.googleapis.com/css?family=Roboto:400,300,700”不安全。此请求已被阻止;内容必须通过 HTTP 提供

混合内容:“https://new.mydomain.id/”处的页面通过 HTTPS 加载,但请求的样式表“http://new.mydomain.id/++resource++plone-admin-ui.css”不安全。此请求已被阻止;内容必须通过 HTTPS 提供。

是否可以传递任何特殊的环境变量以使用 HTTPS 进行所有通信?

之前,我在同一个反向代理后面安装了 OJS3 Web 应用程序,得到了相同的错误消息,但通过将环境变量 HTTPS=on 传递给容器来解决。

我希望 Plone 也有类似的环境变量。我使用 Traefik 1.7.16

【问题讨论】:

    标签: https reverse-proxy plone traefik


    【解决方案1】:

    您需要正确配置代理重写 URL,包括 Virtual Host Monster (VHM) 部分。这样,Zope 的 VHM 可以正确地重写请求。

    可以在此处找到 Nginx 的示例:

    https://docs.plone.org/manage/deploying/front-end/nginx.html#minimal-nginx-front-end-configuration-for-plone-on-ubuntu-debian-linux

    基本上,重写 URL 应该是这样的:

           Protocol plus domain or address of the proxied server
           |                      Protocol of frontend server
           |                      |    Domain of frontend server
           |                      |    |           Port of frontend server
           |                      |    |           |   Path to Plone site root
           V                      V    V           V   V
    http://plone/VirtualHostBase/http/yoursite.com:80/Plone/VirtualHostRoot/
    

    有关 VHM 的更多信息:https://zope.readthedocs.io/en/latest/zopebook/VirtualHosting.html

    【讨论】:

      猜你喜欢
      • 2021-05-30
      • 2021-10-22
      • 1970-01-01
      • 2021-02-12
      • 1970-01-01
      • 2011-03-30
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多