1、通过nginx,对chrome浏览器适用
/etc/nginx/nginx.conf
在http下
添加 add_header Content-Security-Policy "frame-ancestors *.888.com";
或者 add_header Content-Security-Policy "frame-ancestors *.888.com *.999.net";
2、通过php,对ie浏览器适用,chrome不支持X-Frame-Option的allow-from
在相关php文件内的<?php下添加
header('X-Frame-Options: allow-from http://player.888.com/');
如果有多个域名可以添加如下
header('X-Frame-Options: allow-from http://player.888.com/');
header('X-Frame-Options: allow-from http://player.999.net/');