"Access Through Untrusted Domain" error when accessing Nextcloud from another container

I have a running instance of Nextcloud 28.0.0.1 on a Docker community image container.

I’m setting up another container (go-vod) for transcoding for the Memories photo app, however I am having trouble accessing the Nextcloud container from the go-vod container (it needs to download a binary from Nextcloud).

I have confirmed that both containers are on the same network. I try doing a manual curl from inside the go-vod container:

curl http://cloud-application/index.php/apps/memories/static/go-vod?arch=x86_64

The response I get from Nextcloud contains Access through untrusted domain so Nextcloud is reachable, but there likely an issue with trusted_domains. I am not sure what though, because I have added both the name and the IP address of the go-vod container to trusted domains in the Nextcloud config.

This is from the Nextcloud container log when I attempt to do the manual curl from the go-vod container:

172.15.70.3 - - [29/Jan/2024:14:24:47 +0000] "GET /index.php/apps/memories/static/go-vod?arch=x86_64 HTTP/1.1" 400 8625 "-" "curl/7.74.0"

I added the go-vod container IP and name to the trusted_domain using the occ command inside the nextcloud container and restarted it. Running the following command confirms that they have been added:

docker exec --user www-data cloud-application php occ config:system:get trusted_domains

What might be the issue here. Anything more I can do to troubleshoot?

this setting works other way round - you have to add the domain you use inside the other container (basically the name of nextcloud container) to trusted domains. In your example curl http://cloud-application/index.php/... trusted domain gonna be cloud-application

1 Like

Hi @wwe. Thanks for the reply … I just figured it out myself 5 minutes ago :smiley: It makes sense, but it is easy to be confused!

1 Like