使用CloudFlare SSL时未加载资产 [英] Assets not loaded when using CloudFlare SSL

查看:109
本文介绍了使用CloudFlare SSL时未加载资产的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我最近从CloudFlare Flexible SSL安装了SSL,但是当我使用https时,似乎没有加载图像和CSS资产.

我已经禁用了热链接保护.

以下是一些图片来说明差异:

使用https : http://gyazo.com/ef6ccb13c2c8f3f797dcb2d947a772cb

>

不使用https : http://gyazo.com/be277259e0dcc8e395316b573de12935

感谢您的帮助!

解决方案

在浏览器控制台上看到的消息很多,像这样:

混合内容:" https://hornetvault.com/上的页面已通过HTTPS加载,但已请求不安全的样式表' http://www.hornetvault.com/templates/fresh /assets/css/styles.css ".该请求已被阻止;内容必须通过HTTPS提供.

这意味着您尝试在https://站点内使用http://加载资源,并且这些资源被阻止.您还需要通过https://加载这些资源.您可能会尝试简单地使用//而不是在URL中显式地指定http://https://,在这种情况下,它将仅使用与页面本身相同的方案(http或https).

I recently installed SSL from CloudFlare Flexible SSL but when I use https it doesn't seem to load image and CSS assets.

I already disabled hotlink protection.

Here are some images to illustrate the difference:

Using https: http://gyazo.com/ef6ccb13c2c8f3f797dcb2d947a772cb

Not using https: http://gyazo.com/be277259e0dcc8e395316b573de12935

Thankful for help!

解决方案

A look at the browsers console shows lots of messages like this:

Mixed Content: The page at 'https://hornetvault.com/' was loaded over HTTPS, but requested an insecure stylesheet 'http://www.hornetvault.com/templates/fresh/assets/css/styles.css'. This request has been blocked; the content must be served over HTTPS.

Which means you try to load resources using http:// inside a https:// site and these resources get blocked. You need to load these resources by https:// too. You might try to simple use // instead of explicitly given http:// or https:// in your URLs, in which case it will simply use the same scheme (http or https) as the page itself.

这篇关于使用CloudFlare SSL时未加载资产的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆