How to call Mattermost with Nextcloud as an external site of Nextcloud

There is a function that can register the external site with the additional application of Nextcloud, I want to call Mattermost there. But I can’t call Mattermost because it’s “Rejected by CSP” in Firefox, a blank page in Chrome.

I install Nextcloud and Mattermost on the same server and use separate domains.
Nextcloud: a.mydomain.com
Mattermost: b.mydomain.com
*Server: CentOS 7.6, nginx 1.14.2, MariaDB 10.2.25

I wrote the following in Mattermost side nginx.conf.

add_header X-Frame-Options "ARROW-FROM http://a.mydomain.com";
add_header Content-Security-Policy "frame-ancestors 'self' a.mydomain.com";

In this case, NC can call Mattermost just after restarting nginx. However, it is denied after the second access such as updating. Next, I specified a wildcard in the URL specification, but there was no change.

How can I get Mattermost to be called from NC?

A similar question exists in the past topic, but I made this topic anew as there is no progress.

Hi @Babbles,

Mattermost now supports running in a sub path (e.g. mydomain.com/mattermost) I would recommend to go this path as you then do not have to mess csp policies.