Assets not loaded when using CloudFlare SSL

江枫思渺然 提交于 2019-12-25 03:32:26

问题


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!


回答1:


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.



来源:https://stackoverflow.com/questions/29565023/assets-not-loaded-when-using-cloudflare-ssl

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!