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

相关推荐
liann1197 小时前
3.2_红队攻击框架--MITRE ATT&CK‌
python·网络协议·安全·网络安全·系统安全·信息与通信
zjun10018 小时前
TCP专栏-1.TCP协议概念说明
网络·网络协议·tcp/ip
仍然.11 小时前
网络编程(二)---TCP字节流套接字编程
网络·网络协议·tcp/ip
Ether IC Verifier13 小时前
OSI网络七层协议详细介绍
服务器·网络·网络协议·计算机网络·php·dpu
环流_14 小时前
HTTP 协议的基本格式
java·网络协议·http
AIwenIPgeolocation15 小时前
IP地址数据服务:赋能游戏行业体验优化与精细化运营
网络协议·tcp/ip·游戏
TechWayfarer16 小时前
2026年IP归属地查询平台选型指南:金融风控、异地登录、离线库全场景实测
网络·网络协议·tcp/ip
Rust研习社16 小时前
Rust + PostgreSQL 极简技术栈应用开发
开发语言·数据库·后端·http·postgresql·rust
信徒_16 小时前
技术选型 RPC 框架
网络·网络协议·rpc