ONLYOFFICE / docker-onlyoffice-nextcloud

MIT License
378 stars 158 forks source link

Unable to show onlyoffice content thru iframe #38

Open etcy opened 4 years ago

etcy commented 4 years ago

Thank you for providing this SUPER easy to install docker-onlyoffice-nextcloud. I was able to install this on a centos with minimal issues. At first, I could not display the calender on other pages (eg. blog) for sharing.

I was lucky to find the following solution through searching:

Edit /var/www/nextcloud/lib/public/AppFramework/Http/ContentSecurityPolicy.php

protected $allowedFrameDomains = [
'https://*.yourdomain.com',  /** add this line */
];
/** @var array Domains which can embed this Nextcloud instance /
protected $allowedFrameAncestors = [
‘‘self’’,
'https://*.yourdomain.com', /** add this line */
]

With this I was able to share calender but not so for office docs and excel. In the iframe, it shows the nextcloud top bar but does not load onlyoffice at all. The links were fine as themselves,

I hope someone can help give me a hint because I have been at this for a few days and I have very limited knowledge about nginx and server stuff.

pintaf commented 4 years ago

Try to add some CSP , Content Security Policy headers in nginx config of the webserver. https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy/frame-ancestors