場景描述:
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/