https网页加载http资源时不显示图片,报错解决方案

2023-05-16

https网页加载http资源时不显示图片,报错解决方案

  • 自动将http的不安全请求升级为https
  • 静态文件放置本地
  • 反向代理请求http资源

加载http资源时会报错:在这里插入图片描述

自动将http的不安全请求升级为https

页面的head中加入:

<meta http-equiv="Content-Security-Policy" content="upgrade-insecure-requests">

upgrade-insecure-requests可以让浏览器帮忙做 http->https 转换。启用这个策略后,有两个变化:

  1. 页面所有 HTTP 资源,会被替换为 HTTPS 地址再发起请求
  2. 页面所有站内链接,点击后会被替换为 HTTPS 地址再跳转

注意 upgrade-insecure-requests 只替换协议部分,所以只适用于 HTTP/HTTPS 域名和路径完全一致的场景。

静态文件放置本地

如果是请求静态资源,可以将得到的资源上传到站点服务器,再通过本地路径请求。

反向代理请求http资源

如果请求的资源不支持https请求,可通过nginx反向代理访问,将https转发到http。

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

https网页加载http资源时不显示图片,报错解决方案 的相关文章

  • 盒子(Box)

    Box Time limit 3 000 seconds Ivan works at a factory that produces heavy machinery He hasa simple job he knocks up woode
  • 循环小数(Repeating Decimals)

    Repeating Decimals Time limit 3 000 seconds Repeating Decimals The decimal expansion of the fraction 1 33 is wherethe is
  • 反片语(Ananagrams)

    反片语 Ananagrams 输入一些单词 xff0c 找出所有满足如下条件的单词 xff1a 该单词不能通过字母重排 xff0c 得到输入文本中的另外一个单词 在判断是否满足条件时 xff0c 字母不分大小写 xff0c 但在输出时应保留
  • 集合栈计算机(The SetStack Computer)

    The SetStack Computer Time limit 3 000 seconds 题目是这样的 xff1a 有一个专门为了集合运算而设计的 集合栈 计算机 该机器有一个初始为空的栈 xff0c 并且支持以下操作 xff1a PU
  • 代码对齐(Alignment of Code)

    Alignment of Code Time Limit 4000 2000 MS Java Others Memory Limit 32768 32768 K Java Others Total Submission s 958 Acce
  • Ducci序列(Ducci Sequence)

    Ducci Sequence Time limit 3 000 seconds A Ducci sequence is a sequence of n tuples of integers Given an n tuple of integ
  • 卡片游戏(Throwing cards away I)

    Problem B Throwing cards away I Given is an ordered deck of n cards numbered 1 to n with card 1 at the top and card n at
  • 交换学生(Foreign Exchange)

    Problem E Foreign Exchange Input standard input Output standard output Time Limit 1 second Your non profit organization
  • CAN通信物理容错测试checklist

    CAN通信物理容错测试checklist 工作项目中 xff0c 我们有时有些产品CAN总线功能 xff0c 一般情况下我们必须要满足以下几种状况的测试项才算符合要求 一 CAN H与CAN L短路 判定标准 xff1a 短接故障发生后 x
  • 对称轴(Symmetry)

    Symmetry Time limit 3 000 seconds The figure shown on the left is left right symmetric as it is possible to fold the she
  • 打印队列(Printer Queue)

    Printer Queue Time limit 3 000 seconds 分析 首先记录所求时间它在队列中的位置 xff0c 用一个队列存储这些任务的优先级 xff0c 同时也创建一个队列存储对应任务一开始的位置 xff0c 那么当我们
  • 更新字典(Updating a Dictionary)

    Updating a Dictionary Time Limit 1000MS Memory Limit Unknown 64bit IO Format lld amp llu Submit Status Description In th
  • 铁轨(Rails)

    Rails Time limit 3 000 seconds Rails There is a famous railway station in PopPush City Country there is incredibly hilly
  • 矩阵链乘(Matrix Chain Multiplication)

    Matrix Chain Multiplication Time Limit 3000MS Memory Limit Unknown 64bit IO Format lld amp llu Submit Status Description
  • 天平(Not so Mobile)

    Not so Mobile Time Limit 3000MS Memory Limit Unknown 64bit IO Format lld amp llu Submit Status Description Before being
  • 下落的树叶(The Falling Leaves)

    The Falling Leaves Time Limit 3000MS Memory Limit Unknown 64bit IO Format lld amp llu Submit Status Description Each yea
  • 四分树(Quadtrees)

    Quadtrees Time Limit 3000MS Memory Limit Unknown 64bit IO Format lld amp llu Submit Status Description A quadtree is a r
  • 油田(Oil Deposits)

    Oil Deposits Time Limit 3000MS Memory Limit Unknown 64bit IO Format lld amp llu Submit Status Description The GeoSurvCom
  • Abbott的复仇(Abbott's Revenge)

    Abbott 39 s Revenge Time limit 3 000 seconds Abbott s Revenge Abbott s Revenge The 1999 World FinalsContest included a p
  • rockchip rk3568 openwrt修改根文件系统分区

    rk3568的openwrt根文件系统分区大小如何修改 xff1f 1 rootfs大小取决于rk356x config的配置 xff0c 默认CONFIG TARGET ROOTFS PARTSIZE 61 512 xff0c 如果需要修

随机推荐

  • 除法(Division)

    Division Time Limit 3000MS Memory Limit Unknown 64bit IO Format lld amp llu Submit Status Description Write a program th
  • 最大乘积(Maximum Product)

    Maximum Product Time Limit 3000MS Memory Limit Unknown 64bit IO Format lld amp llu Submit Status Description Problem D M
  • 分数拆分(Fractions Again?!)

    Fractions Again Time Limit 3000MS Memory Limit Unknown 64bit IO Format lld amp llu Submit Status Description Problem A F
  • 二叉树(Tree Recovery)

    Tree Recovery Time Limit 3000MS Memory Limit Unknown 64bit IO Format lld amp llu Submit Status Description Little Valent
  • 骑士的移动(Knight Moves)

    Knight Moves Time Limit 3000MS Memory Limit Unknown 64bit IO Format lld amp llu Submit Status Description A friend of yo
  • 单词(Play On Words)

    分析 首先需对欧拉道路有所了解 存在欧拉道路的充分条件 xff1a 对于无向图而言 xff0c 如果一个无向图是连通的 xff0c 且最多只有两个奇点 xff08 顶点的度数为奇数 xff09 xff0c 则一定存在欧拉道路 如果有两个奇点
  • 成语接龙(Idiomatic Phrases Game)

    Idiomatic Phrases Game Problem Description Tom is playing a game called Idiomatic Phrases Game An idiom consists of seve
  • DijKstra算法(单源最短路径)

    原文转载自 xff1a 梦醒潇湘love 转载原文是为了方便自己学习 xff0c 也希望能让更多读者在需要的情况下学到更多的知识 Dijkstra xff08 迪杰斯特拉 xff09 算法是典型的最短路径路由算法 xff0c 用于计算一个节
  • Floyd算法(最短路径)

    Floyd 算法允许图中有带负权值的边 xff0c 但不许有包含带负权值的边组成的回路 原文转载自 xff1a 梦醒潇湘love 上一篇文章我们通过迪杰斯特拉算法解决了从某个源点到其余各顶点的最短路径问题 从循环嵌套很容易得到此算法的时间复
  • 最爱的城市

    最爱的城市 时间限制 xff1a 1 秒 内存限制 xff1a 32 兆 特殊判题 xff1a 否 标签 Floyd最短路径 题目描述 一天小明捧着一本世界地图在看 xff0c 突然小明拿起笔 xff0c 将他最爱的那些城市标记出来 xff
  • Docker中配置Nginx多域名配置多个应用

    注意容器中是一个被隔离的空间 xff0c 可以理解为一个独立的服务器 xff0c 所以在做反向代理的时候 xff0c nginx配置不能使用localhost xff0c 可以使用link方式去访问其他容器 nginxa container
  • 八皇后问题(回溯法)

    八皇后问题 xff08 源于 刘汝佳的 算法竞赛入门经典 xff08 第2版 xff09 xff09 在棋盘上放置8个皇后 xff0c 使得它们互不攻击 xff0c 此时每个皇后的攻击范围为同行同列和同对角线 xff0c 要求找出所有解 x
  • 大整数的乘法

    大整数的乘法 xff08 这里主要讨论的是两个较大的数相乘的效率问题 xff0c 实际上并不是真正意义上的大数相乘 在java中有个BigInteger类已经可以储存大数 xff0c 并提供了大数相乘的方法了 xff09 分析 首先 xff
  • 2的次幂表示

    2的次幂表示 时间限制 xff1a 1 0s 内存限制 xff1a 512 0MB 问题描述 任何一个正整数都可以用2进制表示 xff0c 例如 xff1a 137的2进制表示为10001001 将这种2进制表示写成2的次幂的和的形式 xf
  • 扑克序列

    扑克序列 题目描述 标题 xff1a 扑克序列 A A 2 2 3 3 4 4 xff0c 一共4对扑克牌 请你把它们排成一行 要求 xff1a 两个A中间有1张牌 xff0c 两个2之间有2张牌 xff0c 两个3之间有3张牌 xff0c
  • 分糖果

    分糖果 时间限制 xff1a 1 0s 内存限制 xff1a 256 0MB 问题描述 有n个小朋友围坐成一圈 老师给每个小朋友随机发偶数个糖果 xff0c 然后进行下面的游戏 xff1a 每个小朋友都把自己的糖果分一半给左手边的孩子 一轮
  • 最长公共子序列(LCS)

    最长公共子序列LCS问题 给定2个序列X和Y xff0c 当另一序列Z既是X的子序列又是Y的子序列时 xff0c 称Z是序列X和Y的公共子序列 给定X 61 x1 x2 xm 和Y 61 y1 y2 yn xff0c 请找出X和Y的最长公共
  • 0-1背包问题

    0 1背包问题 甲欲出去旅游 xff0c 可携带20 公斤的行李 xff0c 已知甲想带的 5 件行李的重量及其在旅行中产生的效益如下表所示 xff1a 行李编号 I II III IV V 重量 千克 6 4 8 8 4 行李效益 8 4
  • 旅行售货员问题

    旅行售货员问题 题目 某售货员要到4 个城市去推销商品 xff0c 已知各城市之间的路程 xff0c 如右图所示 请问他应该如何选定一条从城市 1 出发 xff0c 经过每个城市一遍 xff0c 最后回到城市 1 的路线 xff0c 使得总
  • https网页加载http资源时不显示图片,报错解决方案

    https网页加载http资源时不显示图片 xff0c 报错解决方案 自动将http的不安全请求升级为https静态文件放置本地反向代理请求http资源 加载http资源时会报错 xff1a 自动将http的不安全请求升级为https 页面