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

简介: 版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/catoop/article/details/70247993 关于这个错误的详细内容为:Mixed Content: The page at 'https://a.
版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/catoop/article/details/70247993

关于这个错误的详细内容为:

Mixed Content: The page at 'https://a.b.com/detail?id=5' was loaded over HTTPS, but requested an insecure script 'http://a.b.com/xxxxxxx'. This request has been blocked; the content must be served over HTTPS.

这个问题,或许你是再Chrome浏览器的控制台看到的错误提示。

遇到这个问题,既然你百度到这里了,不妨用下面的方法尝试一下是否能解决你的问题。

先简单说一下我的项目部署的结构:
1、nginx
2、tomcat
3、nginx 中配置 https,tomcat 正常使用的 http

出现问题的场景:在进行 redirect 重定向的时候会出现这个问题。

解决问题的过程就不多说了,最终定位的结果是“tomcat的协议http和nginx反向代理的协议https不一致造成的”。

解决方法:
1、在反向代理那里设置一个头 X-Forwarded-Proto ,值设置成 https
2、在 Tomcat 的 server.xml 里添加如下配置:

<Valve className="org.apache.catalina.valves.RemoteIpValve" protocolHeader="X-Forwarded-Proto" />

至此,解决我的问题。
如果解决不了你的问题,再百度看看其他资料^_^,很多问题的导致原因可能是多种的。

目录
相关文章
|
自然语言处理 Kubernetes 安全
服务网格ASM使用FAQ之(1):如何使用WebSocket over HTTP/2协议
为了更好地满足企业日益加深的大规模使用服务网格产品、服务多语言互通、服务精细治理等需求,2022 年 4 月 1 日起,阿里云服务网格产品 ASM 正式发布商业化版本,为企业在生产环境下大规模落地服务网格能力提供性能、安全、高可用、高可靠等服务保障。阿里云内部很早就开始调研并实践 ServiceMesh 技术,通过总结业务场景落地经验,持续驱动技术发展,积累一系列服务网格核心技术,并将其沉淀成为业
511 0
|
2月前
|
安全 应用服务中间件 网络安全
修复HTTPS升级后出现 Mixed Content: The page at 'https://xxx' was loaded over HTTPS, but requested an insecure frame 'http://xxx'. This request has been blocked; the content must be served over HTTPS. 的问题
修复HTTPS升级后出现 Mixed Content: The page at 'https://xxx' was loaded over HTTPS, but requested an insecure frame 'http://xxx'. This request has been blocked; the content must be served over HTTPS. 的问题
|
7月前
解决Error:All flavors must now belong to a named flavor dimension. Learn more at https://d.android.com
解决Error:All flavors must now belong to a named flavor dimension. Learn more at https://d.android.com
123 5
|
存储 XML 数据格式
【SVN异常】svn: E175003: The server at ‘https://svn.example.com/!/%23MyRepo/‘ does not support the HTTP/
【SVN异常】svn: E175003: The server at ‘https://svn.example.com/!/%23MyRepo/‘ does not support the HTTP/
299 0
|
前端开发 JavaScript
【WEB前端】【报错解决】This request has been blocked; the content must be served over HTTPS.
【WEB前端】【报错解决】This request has been blocked; the content must be served over HTTPS.
1190 0
|
JavaScript 网络安全
Mixed Content: The page at ‘<URL>‘ was loaded over HTTPS, but requested an insecure frame ‘<URL>‘...
Mixed Content: The page at ‘<URL>‘ was loaded over HTTPS, but requested an insecure frame ‘<URL>‘...
971 0
|
Web App开发 安全 前端开发
Mixed Content: The page at was loaded over HTTPS, but requested an insecure imag
Mixed Content: The page at was loaded over HTTPS, but requested an insecure imag
468 0
Mixed Content: The page at was loaded over HTTPS, but requested an insecure imag
|
前端开发 JavaScript
uniapp真机调试文件查找失败:‘./pages/index/index.nvue?mpType=page‘; Error: Cannot find module ‘pages/ ———————————————— 版权声明:本文为CSDN博主「前端老实人」的原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接及本声明。 原文链接:https://blog.csdn.net/weixin_52691965/article/details/119241451
uniapp真机调试文件查找失败:‘./pages/index/index.nvue?mpType=page‘; Error: Cannot find module ‘pages/ ———————————————— 版权声明:本文为CSDN博主「前端老实人」的原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接及本声明。 原文链接:https://blog.csdn.net/weixin_52691965/article/details/119241451
|
3月前
|
监控 安全 搜索推荐
设置 HTTPS 协议以确保数据传输的安全性
设置 HTTPS 协议以确保数据传输的安全性
下一篇
无影云桌面