How to Grant Access from extern Website to Nextcloud?


I built an unity web-game and uploaded it to The game is accessing a text-file which is placed in my next cloud. The game is not working, this is the error:
Access to XMLHttpRequest at ‘’ from origin ‘’ has been blocked by CORS policy: No ‘Access-Control-Allow-Origin’ header is present on the requested resource.

Any idea how to solve the problem?

I run a Nextcloud 20.0.7 on Ubuntu server, snap-installation.

I tried this, but does not work either:
sudo nextcloud.occ config:system:set trusted_domains 2

Instead of I tried several others, for example my private site of I even installed the game on an Webpage, and put this webpage as trusted domain, but allways the same error.

When I get the trusted domains it says

So in the last line a „:“ is added. Why?