odoo开发笔记 -- 跨域Refused to display in a frame because it set 'X-Frame-Options' to 'DENY'

场景描述:

odoo界面嵌入iframe,Refused to display in a frame because it set 'X-Frame-Options' to 'DENY'

跨域请求失败处理!

处理过程

修改目标访问服务器的nginx或者apache的配置文件,这里用的apache;

具体参数配置参考:https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-Frame-Options

需要在apache httpd.conf中末尾增加如下配置:

Header set X-Frame-Options "allow-from http://www.yousite.com你系统的域名"

并且将 #LoadModule headers_module 前面的 # 号去掉。

重启apache服务,OK!

 

参考:

http://www.webkaka.com/tutorial/server/2018/020623/

http://www.webkaka.com/tutorial/server/2018/012919/

你可能感兴趣的:(odoo开发笔记 -- 跨域Refused to display in a frame because it set 'X-Frame-Options' to 'DENY')