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

相关推荐
小蜗牛的路12 小时前
使用OpenSSL生成本地证书https+nginx
网络协议·nginx·https
FPGA小迷弟13 小时前
vivado中的AXI Interconnect到底应该怎么用,他的底层原理是什么,一篇文档全部理清楚!!!
网络协议·tcp/ip·fpga开发·verilog·fpga
网络攻城狮_13 小时前
网络协议大全
运维·网络·网络协议·http
hbugs0011 天前
【案例分享】全网首个华三数据中心流量可视化实验,基于EVE-NG V7平台
网络·网络协议·安全·devops·eve-ng
中云DDoS CC防护蔡蔡1 天前
短信验证码被攻击怎么办
运维·经验分享·http·网络安全·微信
yxl874646461 天前
PCTG-1015型Profinet转Ethernet/IP协议转换器
服务器·网络·物联网·网络协议·自动化·信息与通信
pW3g3lLuu1 天前
.NET 高级开发 | http 接口对接和客户端开发技巧
网络协议·http·.net
山海云端有限公司1 天前
全平台视频元数据解析 API:从原理到 Python 实战调用
python·http·api·元数据·视频解析·apizero
阿标在干嘛1 天前
政策快报爬虫的生存指南:IP池、浏览器模拟、验证码识别实战
爬虫·网络协议·tcp/ip
墨香幽梦客2 天前
数据安全三板斧:Https/SSL加密+PCI-DSS合规+HIPAA医疗数据防护
网络协议·https·ssl