加载中…
个人资料
  • 博客等级:
  • 博客积分:
  • 博客访问:
  • 关注人气:
  • 获赠金笔:0支
  • 赠出金笔:0支
  • 荣誉徽章:
正文 字体大小:

https跨域Thisrequesthasbeenblocked;thecontentmustbeservedoverHTTPS

(2022-04-01 16:53:07)

https跨域Thisrequesthasbeenblocked;thecontentmustbeservedoverHTTPS

解决方案:

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

可以在相应的页面的

里加上这句代码,意思是自动将http的不安全请求升级为https

 

This request has been blocked; the content must be served over HTTPS

HTTPS 承载的页面上不允许出现 http 请求,一旦出现就是提示或报错:

This request has been blocked; the content must be served over HTTPS

 

解决方案:

html:

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

 

php:

header("Content-Security-Policy: upgrade-insecure-requests");

nginx:在server模块增加

add_header Content-Security-Policy "upgrade-insecure-requests;connect-src *";

0

阅读 收藏 喜欢 打印举报/Report
  

新浪BLOG意见反馈留言板 欢迎批评指正

新浪简介 | About Sina | 广告服务 | 联系我们 | 招聘信息 | 网站律师 | SINA English | 产品答疑

新浪公司 版权所有