ReinerNippes / nextcloud_on_docker

Run Nextcloud in Docker Container on various Linux Hosts
MIT License
203 stars 48 forks source link

Change Header X-Frame-Options #26

Closed ConsultorML closed 4 years ago

ConsultorML commented 4 years ago

Hi, how can I change the "Header X-Frame-Options" from SAMEORIGIN to ALLOW-FROM? I have installed Traefik, but it's not possible change anything on it.

I tried adding the line add_header X-Frame-Options "allow-from https://*.domain.tld" always; in /opt/nextcloud/config/nginx.conf and change settings in /opt/nextcloud/www/lib/public/AppFramework/Http/ContentSecurityPolicy.php but the changes are not reflected in the Traefik dashboard, so I guess I have to configure something related to Traefik.

[modified] guide: https://help.nextcloud.com/t/solved-nextcloud-16-how-to-allow-iframe-usage/52278/5

Thanks in advance!

ReinerNippes commented 4 years ago

Hi, for the nginx container you'll find it here:

https://github.com/ReinerNippes/nextcloud_on_docker/blob/f7a88d8099ade0e6f4699f6a2eb9e41d875ba309/roles/docker_container/tasks/nginx.yml#L49

You have to edit this line and rerun the playbook. Maybe you have to remove the traefik container first.

ConsultorML commented 4 years ago

I was able to change the configuration of Nginx (it was not necessary to delete Traefik), but unfortunately it did not affect the behavior of the iframes as I expected. I will find out what else can be done and try to reinstall from scratch. Anyway, very useful. Thank you!