【原创】在第三方网站嵌入nextcloud21.0.0页面的方法

nextcloud系统默认是不允许自己的页面被其他网站以iframe的形式嵌入的

在这里可以将lib/private/legacy/OC_Response.php中的header('X-Frame-Options: SAMEORIGIN'); 注释掉

 

网上也有说在lib/public/AppFramework/Http/ContentSecurityPolicy中的

protected $allowedFrameDomains['http://172.18.109.105:81']及
    protected $allowedFrameAncestors = [
      '\'self\'',
      'http://172.18.109.105:81',
   ];
数组中加入允许嵌入页面的域名,但我没有用到这一步,在此记录下载作为备用
参考链接:https://help.nextcloud.com/t/embedding-nextcloud-iframe/81334
https://return2.net/nextcloud-enable-external-iframe/
点赞

发表回复

电子邮件地址不会被公开。必填项已用 * 标注