随身笔记
随身笔记

Refused to display 'xxx.com' in a frame because it set 'X-Frame-Options' to 'sameorigin'.

‘sameorigin’只允许同域名的地址在iframe中使用

 

解决:修改xxx.com的nginx或者apache的设置

 

在配置文件中加入X-Frame-Options属性的值:

https://sdeno.com/wp-content/uploads/2022/11/ng20221129151134.png

参考值:

add_header X-Frame-Options ALLOWALL; #允许所有域名iframe

add_header X-Frame-Options DENY; #不允许任何域名iframe,包括相同的域名

add_header X-Frame-Options SANEORIGIN; #允许相同域名iframe,如a.test.com允许b.test.com

add_header X-Frame-Options ALLOW-FROM uri; #允许指定域名iframe

修改完成之后记得重启Nginx服务,重启之后配置生效,再次请求,搞定。

https://blog.csdn.net/qq_36527174/article/details/110873134

没有标签
首页      前端资源      wordpress教程      Refused to display 'xxx.com' in a frame because it set 'X-Frame-Options' to 'sameorigin'.

随身笔记

Refused to display 'xxx.com' in a frame because it set 'X-Frame-Options' to 'sameorigin'.
'sameorigin'只允许同域名的地址在iframe中使用   解决:修改xxx.com的nginx或者apache的设置   在配置文件中加入X-Frame-Options属性的值: 参考值: add…
扫描二维码继续阅读
2022-11-29