HTTPS页面里动态的引入HTTP资源,比如引入一个js文件,会被直接block掉的.在HTTPS页面里通过AJAX的方式请求HTTP资源,也会被直接block掉的。

Mixed Content: The page at 'xxx' was loaded over HTTPS, but requested an insecure resource 'xxx'. This request has been blocked; the content must be served over HTTPS.

解决办法:

页面的head中加入:

<meta http-equiv="Content-Security-Policy" content="upgrade-insecure-requests">

意思是自动将http的不安全请求升级为https

注意:在需要的网页上加上面的语句,

其它不需要的网页不需要加,不然后了出错的。

CSP设置upgrade-insecure-requests

好在 W3C 工作组考虑到了我们升级 HTTPS 的艰难,在 2015 年 4 月份就出了一个 Upgrade Insecure Requests 的草案,他的作用就是让浏览器自动升级请求。

在我们服务器的响应头中加入:

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

转载:https://blog.csdn.net/u012259256/article/details/72039950

https://www.cnblogs.com/hustskyking/p/upgrade-insecure-requests.html

https://blog.csdn.net/haibo0668/article/details/82947917

错误:Mixed Content: The page at ‘https://XXX’ was loaded over HTTPS, but requested an insecure.......相关推荐

  1. JS错误:Mixed Content: The page at ‘https://XXX’ was loaded over HTTPS, but requested an insecure 新的问题

    文章目录 JS错误:Mixed Content: The page at 'https://XXX' was loaded over HTTPS, but requested an insecure ...

  2. 解决Mixed Content: The page at https://xxx was loaded over HTTPS

    背景:现有一个项目,网站访问地址示例为 https://www.testcase.com,其中某个功能需要用到外部的服务(例如http:42.192.36.246/api/api.js),并且这个服务 ...

  3. 错误:Mixed Content: The page at ‘https://XXX’ was loaded over HTTPS, but requested an in...

    在使用Tomcat+Nginx时.Nginx使用https,Tomcat使用http.使用iframe之类框架,在重定向时会出现以上问题导致页面加载不出来.这是因为Tomcat不知道Nginx发来的是 ...

  4. Mixed Content: The page at“https://xxx”was loaded over HTTPS, but requested an insecure

    一,现象 接口请求通,查看network 二,原因 https的服务不可以请求http的接口,如果必须要使用,那么就需要在自己的服务器上做反向代理.

  5. vue项目高德地图Mixed Content: The page at ‘https://****.com/cockpit/‘ was loaded over HTTPS, b

    vue项目高德地图引入https相关报错 vue项目中高德地图引入相关问题 原因和解决方案 vue项目中高德地图引入相关问题 公司年前一个vue项目一期,其中有个数据可视化模块引入了高德地图,年前发布 ...

  6. http请求https报错:Mixed Content: The page at ‘xxx‘ was loaded over HTTPS, but requested an insecure...

    当我们的浏览器出现类似"was loaded over HTTPS, but requested an insecure resource/frame"这种错误是,一般都是因为我们 ...

  7. html页面和手机比例一致 一比一自适应 Mixed Content: The page at ‘xxx‘ was loaded over HTTPS, but requested an insec

    1. HTML页面与手机端一比一适应 这行代码是一比一自适应,目的是让手机端看见的网页和在电脑上看见的相同,不写这一行会导致手机上的网页特别小. 原因是电脑显示的是px和手机上像素单位不一致,在< ...

  8. 错误:Mixed Content: The page at 'https://a.b.com/detail?id=5' was loaded over HTTPS, but reque

    关于这个错误的详细内容为: Mixed Content: The page at 'https://a.b.com/detail?id=5' was loaded over HTTPS, but re ...

  9. 修复报错Mixed Content: The page at “https://“ was loaded over HTTPS, but requested an insecure “http://“

    当浏览器出现"was loaded over HTTPS, but requested an insecure resource/frame"这种错误是,一般都是因为网站是HTTP ...

  10. 解决Mixed Content: The page at https://* was loaded over HTTPS, but requested an insecure XMLHttpReque

    目录 项目场景 问题描述 原因分析 解决方案 一些问题 项目场景 https协议的网站下请求http的资源 问题描述 https协议的网站请求http协议的资源被浏览器任务不安全,请求被拦截并且报了以 ...

最新文章

  1. 巨人网络开发工程师试题
  2. 06 - java 方法
  3. Android-Socket的最基础实现以及遇见在2.3可用4.3不可用的解决方法
  4. 前端开发 填充padding 0229
  5. 平均年薪 70 万!刚刚,这类程序员又涨薪了!佩服!
  6. java网站开发模式有哪些_第7章JavaWeb常用开发模式.ppt
  7. TPC,TPCC,TPMC(数据库性能衡量指标)
  8. error: Microsoft Visual C++ 14.0 or greater is required. Get it with “Microsoft C++ Build Tools“
  9. VMware安装CentOS 7.0 Fail to start media check on /dev/sr0
  10. 互联网人职业发展之路:三年升高工,七年做架构,十年送外卖
  11. 关于 Sensor flicker/banding现象的解释
  12. Sen2cor提示:Product metadata file cannot be read报错
  13. SaaS最通俗易懂的解释是什么?看这篇就够了
  14. Windows 11系统IDEA启动时报错:Cannot find keymap “Windows copy” 解决办法
  15. 黑帽SEO的常见操作手法解析
  16. java图形界面编程如何给窗口设置背景图片
  17. 深入浅出地讲解麦克斯韦方程组
  18. 130页5万字某市档案馆数字档案馆建设方案
  19. LINK : fatal error LNK1168: cannot open Debug/Test.exe for writing的解决方法
  20. python画指数函数图像_Python3.0科学计算学习之绘图(一

热门文章

  1. Excel表格常用复制粘贴技巧,你真的会操作?
  2. Qt FTP文件上传下载简单例子
  3. hao916,hao123,2345.com浏览器劫持-分析与清除
  4. Java 8 Update 91 (8u91)
  5. PR中视频材料声音大小不一样?1招快速统一音量
  6. 人再囧途之泰囧bd高清版
  7. 公式推导 圆面积公式 圆周长公式
  8. 畅游陈德文:中国网游的发展与未来趋势
  9. 洛谷 P1510 精卫填海
  10. vue中如何设置鼠标经过切换样式