添加Content Security Policy请求头
  - 
    
方式一:使用
nginx配置在location下添加:add_header Content-Security-Policy "upgrade-insecure-requests;connect-src *";
 
百度得到的很多都让加在server下,这种是不生效的,百度第一页的方法我是都尝试过了,血与泪的教训,坑啊,都是让在server下添加
- 
    
方式二:前端
h5中添加<meta http-equiv="Content-Security-Policy" content="style-src 'self' 'unsafe-inline';script-src 'self' 'unsafe-inline' 'unsafe-eval' https://webapi.amap.com https://restapi.amap.com https://vdata.amap.com https://appx/web-view.min.js;worker-src blob:"> 
      
      
评论区