【问题标题】:Rendering HTTP inside HTTPS request在 HTTPS 请求中呈现 HTTP
【发布时间】:2016-03-11 02:51:54
【问题描述】:

我已经安装了支持 Graphite 的 Icinga 2 监控工具。
Graphite 基本上提供基于 Icinga 2 生成的指标的图表。

它通过 HTTP 工作,但每当我为我的 Apache VHOST 启用 HTTPS 时,它就会停止工作。

以下链接是所请求内容的示例。

https://monitoring.example.com/icingaweb2/graphite?graphite_url=http%253A%252F%252Fgraphite.example.com%252Frender%252F%253F%2526target%253Dicinga2.hostname.services.ping6.ping6.perfdata.rta.value%2526source %253D0%2526width%253D600%2526height%253D400%2526colorList%253D049BAF%2526lineMode%253Dconnected

<VirtualHost *:80>
    ServerName monitoring.example.com

    RewriteEngine On
    RewriteCond %{HTTPS} off
    RewriteRule (.*) https://monitoring.example.com/icingaweb2

    <Location />
        Order allow,deny
        Allow from all
    </Location>
</VirtualHost>

<VirtualHost *:443>
    ServerName monitoring.example.com

    SSLEngine on
    SSLProtocol all -SSLv2
    SSLCipherSuite ALL:!ADH:!EXPORT:!SSLv2:RC4+RSA:+HIGH:+MEDIUM:+LOW
    SSLCertificateFile /etc/ssl/certs/monitoring.example.com.crt
    SSLCertificateKeyFile /etc/ssl/certs/monitoring.example.com.key
    SSLCACertificateFile /etc/ssl/certs/GeoTrust_CA_Bundle.crt

    SetEnvIf User-Agent ".*MSIE.*" \
             nokeepalive ssl-unclean-shutdown \
             downgrade-1.0 force-response-1.0

    Alias "/icingaweb2" "/usr/share/icingaweb2/public"

    <Directory "/usr/share/icingaweb2/public">
        Options SymLinksIfOwnerMatch
        AllowOverride None

        Order allow,deny
        Allow from all

        SetEnv ICINGAWEB_CONFIGDIR "/etc/icingaweb2"

        EnableSendfile Off

        <IfModule mod_rewrite.c>
            RewriteEngine on
            RewriteBase /icingaweb2/
            RewriteCond %{REQUEST_FILENAME} -s [OR]
            RewriteCond %{REQUEST_FILENAME} -l [OR]
            RewriteCond %{REQUEST_FILENAME} -d
            RewriteRule ^.*$ - [NC,L]
            RewriteRule ^.*$ index.php [NC,L]
        </IfModule>

        <IfModule !mod_rewrite.c>
            DirectoryIndex error_norewrite.html
            ErrorDocument 404 /error_norewrite.html
        </IfModule>
    </Directory>           
</VirtualHost>

我已为虚拟主机启用“LogLevel 调试”,但没有错误。 HTTP 响应码总是等于 200。

URL 由以下 PHP 代码编码:

$url = Url::fromPath('graphite', array(
            'graphite_url' => urlencode($largeImgUrl)
        ));

请告诉我可能发生的事情。

【问题讨论】:

    标签: php apache http https


    【解决方案1】:

    似乎无法混合使用 HTTP 和 HTTPS。将graphite.example.com 配置为通过HTTPS 工作解决了这个问题。

    谷歌浏览器控制台说:

    混合内容:页面位于 'https://monitoring.example.com/icingaweb2/monitoring/service/show?host=c…600%2526height%253D400%2526colorList%253D049BAF%2526lineMode%253Dconnected' 已通过 HTTPS 加载,但请求了不安全的图像 'http://graphite.example.com/render/?&target=icinga2.camhpcvm02.services....ht=120&hideAxes=true&lineWidth=2&hideLegend=true&colorList=049BAF&from=-1h'。 此内容也应通过 HTTPS 提供。 show?host=camhpcvm02&service=ssh:1

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2010-10-31
      • 1970-01-01
      • 2012-03-25
      • 2017-11-05
      相关资源
      最近更新 更多