当前位置: 首页 > news >正文

深圳专门做写字楼的网站网站经常被黑

深圳专门做写字楼的网站,网站经常被黑,国家资源库建设网站,淘外网站怎么做目录 1.问题及说明 2.解决方案及示例 3.总结 1.问题及说明 A系统使用了https,在A系统中挂载B系统的http的画面,会报错如下: Mixed Content: The page at https://beef.zz.com/front/#/biz/cultivationList/cultivationDetails/5dbf836751…

目录

1.问题及说明

2.解决方案及示例

3.总结


1.问题及说明

A系统使用了https,在A系统中挂载B系统的http的画面,会报错如下:

Mixed Content: The page at 'https://beef.zz.com/front/#/biz/cultivationList/cultivationDetails/5dbf836751ba4b5d9e246ad44f013200' was loaded over HTTPS, but requested an insecure element 'http://www.aa.com/files/financialAppUpload/20201230/0403e240-95dc-4c91-a032-2262e396c411-20201230.jpg'. This request was automatically upgraded to HTTPS, For more information see https://blog.chromium.org/2019/10/no-more-mixed-messages-about-https.html 

浏览器阻止混合内容的加载,页面的地址是通过 HTTPS 加载的,但是里面有不安全的内容(通过 HTTP 加载,被认为是不安全的),浏览器会在控制台报错,禁止在https系统中加载http的页面。

2.解决方案及示例

①修改浏览器的配置

例如在火狐浏览器中

打开新标签页,在地址栏输入 about:config,进入配置页面。
搜索 security.mixed_content.block_active_content,将true改为false。

重启浏览器后生效

修改后浏览器控制台会弹出警告,不会进行报错。

②将http升级为https

可以将http的系统升级为https

③使用nginx进行反向代理

前端:

前端通过在vue画面中嵌套iframe显示其他系统的http的画面

<template><div class="container"><Breadcrumb :items="['menu.desktop', 'menu.desktop.index']"/><a-card class="general-card" title="数据报表"><iframe class="no-border" :src="windowUrl" width="100%" height="1000"></iframe></a-card></div>
</template><script setup lang="ts">
// 组件引用
import { ref, reactive } from "vue";
import {getData} from "@/api/report";const windowUrl = ref("")
const getInfo = async () => {const res = await getData()const token = res.resBody.tokenconst url = res.resBody.url// popupWindow = window.open(url + "&token=" + token + "&sysFlag=123", "_self")windowUrl.value = url + "&token=" + token + "&sysFlag=123"}
getInfo()
</script>
<!--src/App.vue-->
<script lang="ts">
export default {name: 'Dashboard'};
</script><style scoped lang="less">
.container {padding: 0 20px 20px 20px;
}
.no-border {border: none;
}</style>

假设画面地址为
http://xxx.xxx.xxx:8082/ai/?proc=1&action=viewer&hback=true&db=!7814!603b!.db&platform=PC&browserType=chrome

注意点:

第三方系统的画面地址只需要将/ai/?proc=1&action=viewer&hback=true&db=!7814!603b!.db&platform=PC&browserType=chrome设置到iframe的src中,在vue的配置中添加了基础路径,基础路径为A系统的路径,请求到达nginx之后会将ai的请求转发到对应的页面的服务器中,其他本系统的带有api的请求则转发到本系统的后端服务器中,这样就避免了在https中直接加载https的画面。因为请求的地址会拼接上A系统的带有https的基础路径,整体请求会变为如下:

https://x.xx.com/ai/?proc=1&action=viewer&hback=true&db=!7814!!53d1603b!.db&platform=PC&browserType=chrome

https://x.xx.com:为A系统的基础路径

/ai/?proc=1&action=viewer&hback=true&db=!7814!!53d1603b!.db&platform=PC&browserType=chrome:为B系统的去掉域名后的地址

nginx配置:

将url中带有ai的请求转发到对应的服务器的对应端口中,这样就避免了在


#user  nobody;
worker_processes  1;#error_log  logs/error.log;
#error_log  logs/error.log  notice;
#error_log  logs/error.log  info;#pid        logs/nginx.pid;events {worker_connections  1024;
}http {include       mime.types;default_type  application/octet-stream;#log_format  main  '$remote_addr - $remote_user [$time_local] "$request" '#                  '$status $body_bytes_sent "$http_referer" '#                  '"$http_user_agent" "$http_x_forwarded_for"';#access_log  logs/access.log  main;sendfile        on;#tcp_nopush     on;#keepalive_timeout  0;keepalive_timeout  65;#gzip  on;server {listen       80 ;server_name  localhost;underscores_in_headers on;  #添加自定义请求头client_max_body_size 1G;  #设置请求体大小location / {root    /usr/share/nginx/html;try_files $uri $uri/ /index.html;index  index.html index.htm;proxy_set_header X-Forwarded-Scheme  $scheme;}location /api/ {proxy_set_header Host $host;proxy_set_header X-Real-IP $remote_addr;proxy_set_header REMOTE-HOST $remote_addr;proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;proxy_pass http://xx.xx.xx.xx:8098/;}location /ai/ {proxy_set_header Host $host;proxy_set_header X-Real-IP $remote_addr;proxy_set_header REMOTE-HOST $remote_addr;proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;proxy_pass http://xx.xx.xx.xx:8082;}location /img/ {alias /data/files/xx/;}}}

3.总结

一般使用nginx反向代理的方式,现在前端都需要部署在nginx上,所以使用nginx的方式比较方便

http://www.yayakq.cn/news/654172/

相关文章:

  • 怎么做公司的网站宣传软件开发属于哪个专业
  • 做尽调需要用到的网站网站建设服务
  • 网站备案更改需要多久影楼免费网站建设
  • 网站常用素材阿里巴巴运营流程
  • 莱芜做网站的公司wordpress首页登陆
  • 游戏开发 网站开发 难度微网站自定义脚本
  • 公众号购买网站天津h5模板建站
  • 海外公司网站 国内做备案jsp购物网站开发
  • 网站设计的工作内容新校区建设网站管理规定
  • 仿牌 镜像网站wordpress 主题使用教程
  • 广州市平安建设 网站电商图片制作软件
  • 可以做游戏的网站施工企业会计案例分析论文
  • 合肥专业的房产网站建设宣传推广方案
  • golang做网站怎么样wordpress查看需要密码
  • 株洲网站建设优化企业微信商店小程序制作教程
  • 外贸网站建设方案网页设计模板素材旅游
  • 个人网站对应网站网址网页编程软件叫什么
  • 宁志网站两学一做安徽建站之星
  • 使用cnnic证书的网站素材网站上的元素是怎么做的
  • 网站运营维护措施有哪些中国十大原画培训机构
  • 用git 做网站外贸网站收到询盘
  • 云主机可以放几个网站上海做网站 公司 哪家好
  • 杭州本地网站网络营销网站的功能
  • 做考试平台的网站商派商城网站建设方案
  • 网站建设合作合同模板东莞免费建站公司
  • 网站建设方案封面苏州互联网公司排行榜
  • 地方门户网站规划免费浏览的网站
  • 网站优化公司开始上班了公司企划书模板
  • 黑群晖可以做网站吗管理咨询公司项目运作流程
  • 网站直播是未开票收入怎么做手机模板网站制作