Mixed Content: The page at ‘https://域名/‘ was loaded over HTTPS

场景前端转发给后端后会出现:

Mixed Content: The page at 'https://域名/' was loaded over HTTPS, but requested an insecure XMLHttpRequest endpoint 'http://域名/相关路径'

解决方式在nginx中的相关路由添加指令,具体例子如下:

复制代码
location /路径/ {
      # 确保这里的协议是 http,而不是 https,且端口正确
      proxy_pass http://127.0.0.1:相关端口号; 
      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;   
    }

proxy_set_header X-Forwarded-Proto $scheme; 这个一定要写不然你会一脸蒙圈。

以上来源于博客-------小达博客,关于Mixed Content:The page at...was loaded over https

相关推荐
知识汲取者1 小时前
HTTP、SSE、WebSocket:三个老技术的区别、场景与选型
websocket·http·ai
ShineWinsu3 小时前
对于Qt:TCP的解析
linux·c++·qt·网络协议·面试·tcp·客户端
郝学胜-神的一滴5 小时前
Effective Python 条款45:巧用属性注解平滑升级类属性
运维·开发语言·数据库·python·网络协议·numpy
SEO_juper5 小时前
HTTPS 混合内容检查工具:页面全站 https 了,但还有 http 资源在拖后腿
开发语言·网络协议·http·https·node.js·json·bash
进击的荆棘7 小时前
Linux网络——应用层协议HTTP
linux·运维·服务器·网络·http
王亚博_Abel1 天前
域名是怎么变成 IP 的?手拆 DNS 解析四个实验实测
网络·网络协议·tcp/ip
用户84913717547161 天前
两版 SNMP 报文只差 1 个字节,我盯了半天才看懂问题出在哪
网络协议
AndreaYYmm1 天前
SIGUSR2 触发热重载:一个正在抓包的进程如何原子地换掉规则集
c语言·网络协议
Thanks_ks1 天前
RESTful API 到底是什么:从 URL 设计讲到请求方法的选择
spring boot·http·状态码·url·幂等性·restful api·无状态
用户84913717547161 天前
为什么 SNMP 叫"简单"?真相是:设备少干活,复杂全甩给了你
网络协议