zoukankan      html  css  js  c++  java
  • iframe 里面引入soanrqube页面

    直接引用

    <iframe id="iframe" src="http://192.168.2.102:9000" width="1500" height="1000"></iframe>
    

    结果加载失败

    Refused to display 'http://192.168.2.102:9000/' in a frame because it set 'X-Frame-Options' to 'sameorigin'.
    

    解决方法

    使用 ngnix 配置代理,过滤 X-Frame-Options (ngnix.conf)

    server {
            listen       80;
            server_name  localhost;
    
    	location / {
    	    proxy_pass http://192.168.2.102:9000;
    	    proxy_hide_header X-Frame-Options;
    	    add_header Access-Control-Allow-Origin *;
    	    add_header Access-Control-Allow-Methods 'GET, POST, OPTIONS';
    	    add_header Access-Control-Allow-Headers 'DNT,X-Mx-ReqToken,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Authorization';
    	
    	    add_header X-Frame-Options ALLOWALL;	
    	}
    }
    

    iframe 引入

     <iframe id="iframe" src="http://192.168.1.167" width="1500" height="1000"></iframe>
    
  • 相关阅读:
    Postfix邮件服务
    Python
    LVS
    MFS
    Apache
    Zookeeper集群 + Kafka集群 + KafkaOffsetMonitor 监控
    shell 检测安装包
    shell ssh 批量执行
    shell 判断脚本参数
    bzoj 1500 修改区间 splay
  • 原文地址:https://www.cnblogs.com/purple910/p/15115285.html
Copyright © 2011-2022 走看看