Mixed Content: xxx This request has been blocked; the content must be served over HTTPS.

问题描述

HTTPS 是 HTTP over Secure Socket Layer,以安全为目标的 HTTP 通道,所以在 HTTPS 承载的页面上不允许出现 http 请求,一旦出现就是提示或报错:Mixed Content: xxx This request has been blocked; the content must be served over HTTPS.,就可能会无法请求到想要的资源。

解决方法一(对请求的资源地址进行升级,不推荐)

*对请求的资源地址进行升级,也就是说把http请求升级到https请求,做法是在请求头里面设置:

header("Content-Security-Policy: upgrade-insecure-requests");

但是要提醒大家的是:如果你请求的资源没有配置https,那么这就是在做无用功

解决方法二(跨域)

其实问题的根本就是在跨域,那么就当作跨域来处理。vue跨域配置很简单。jq也有跨域。

你可能感兴趣的:(Mixed Content: xxx This request has been blocked; the content must be served over HTTPS.)