错误:Mixed Content: The page at ‘https://XXX’ was loaded over HTTPS, but requested an in...
在使用Tomcat+Nginx时。Nginx使用https,Tomcat使用http。使用iframe之类框架,在重定向时会出现以上问题导致页面加载不出来。这是因为Tomcat不知道Nginx发来的是http还是https。
默认情况下,nginx得到的https的访问会以http的方式发给负载的tomcat。
如果让tomcat知道是https的,需要如下配置
1、配置 Nginx 的转发选项:
proxy_set_header Host $host;proxy_set_header X-Real-IP $remote_addr;proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;proxy_set_header X-Forwarded-Proto $scheme;
2、配置Tomcat server.xml 的 Engine 模块下配置一个 Value:
<Valve className="org.apache.catalina.valves.RemoteIpValve"remoteIpHeader="X-Forwarded-For" protocolHeader="X-Forwarded-Proto"protocolHeaderHttpsValue="https"/>
配置双方的 X-Forwarded-Proto 就是为了正确地识别实际用户发出的协议是 http 还是 https。
X-Forwarded-For 是为了获得实际用户的 IP。
原文:https://www.jianshu.com/p/c2bfd951d003
错误:Mixed Content: The page at ‘https://XXX’ was loaded over HTTPS, but requested an in...相关推荐
- 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 ...
- 解决Mixed Content: The page at https://xxx was loaded over HTTPS
背景:现有一个项目,网站访问地址示例为 https://www.testcase.com,其中某个功能需要用到外部的服务(例如http:42.192.36.246/api/api.js),并且这个服务 ...
- Mixed Content: The page at“https://xxx”was loaded over HTTPS, but requested an insecure
一,现象 接口请求通,查看network 二,原因 https的服务不可以请求http的接口,如果必须要使用,那么就需要在自己的服务器上做反向代理.
- vue项目高德地图Mixed Content: The page at ‘https://****.com/cockpit/‘ was loaded over HTTPS, b
vue项目高德地图引入https相关报错 vue项目中高德地图引入相关问题 原因和解决方案 vue项目中高德地图引入相关问题 公司年前一个vue项目一期,其中有个数据可视化模块引入了高德地图,年前发布 ...
- 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"这种错误是,一般都是因为我们 ...
- html页面和手机比例一致 一比一自适应 Mixed Content: The page at ‘xxx‘ was loaded over HTTPS, but requested an insec
1. HTML页面与手机端一比一适应 这行代码是一比一自适应,目的是让手机端看见的网页和在电脑上看见的相同,不写这一行会导致手机上的网页特别小. 原因是电脑显示的是px和手机上像素单位不一致,在< ...
- 错误: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 ...
- 修复报错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 ...
- 解决Mixed Content: The page at https://* was loaded over HTTPS, but requested an insecure XMLHttpReque
目录 项目场景 问题描述 原因分析 解决方案 一些问题 项目场景 https协议的网站下请求http的资源 问题描述 https协议的网站请求http协议的资源被浏览器任务不安全,请求被拦截并且报了以 ...
最新文章
- 在Ubuntu18.04上安装opencv 3.4.1
- 一个6年的菜鸟,在4年之前做的一些功能(二)
- 残差网络的前世今生与原理 | 赠书
- 张恩民 php,php100视频教程第11讲(制作PHP+MYSQL留言板 上)中,张恩民老师提到的php100-11.txt文档...
- [分享]多个选项卡切换效果
- Linux之xargs
- 访问者模式 php,php设计模式 Visitor 访问者模式
- ANSYS——ANSYS后处理操作技巧与各类问题良心大总结
- linux美化原理,x-window字体原理及美化
- Android两个tab吸顶,Android scrollView和viewpager嵌套 指示器吸顶 根据viewpager每
- postgres复制表结构
- 深度学习如何均衡精度、内存、计算和通信开销?
- C++基础14-类和对象之多继承与虚继承
- 整理各个平台的访问入口及快速推文的方法
- Spring Boot 初体验(8)配置server信息
- 7.Magento系统配置(System.xml)
- 【BZOJ 3681】Arietta
- IntelliJ IDEA设置炫酷主题
- 上位机串口数据检验方式(二)——奇偶校验
- 前端工程师年终总结(2019)