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/');