问题
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