// troubleshooting guide · nextcloud
Nextcloud Access Through Untrusted Domain Error
- Status
- Workaround available
- platforms:
- Self-hosted (Docker, TrueNAS, Linux)
- updated:
- November 16, 2026
- reports:
- 4
- Method
- how we research
RUNBOOK · nextcloud/access-through-untrusted-domain4 FIXES
// quick answer
Nextcloud refuses requests whose hostname is not in trusted_domains. Add the domain or IP to config.php (or via occ), and behind a reverse proxy also set trusted_proxies and overwrite settings.
Most likely fix: Add the domain with occ
How to fix it
// try these in order, the most common fix is first
FIX 1Add the domain with occ
- 01Run: sudo -u www-data php occ config:system:set trusted_domains 1 --value=cloud.example.com
- 02Reload the page using exactly that hostname
Did this fix it?FIX 2Edit config.php
- 01Open config/config.php
- 02Add the host or IP to the trusted_domains array
- 03Save and reload
Did this fix it?FIX 3Configure the reverse proxy
- 01Add the proxy IP to trusted_proxies in config.php
- 02Set 'overwriteprotocol' => 'https' and overwritehost to your public host
- 03Use overwritecondaddr if the server is also reachable directly
- 04If redirect loops appear, test with and without overwriteprotocol
Did this fix it?FIX 4Check Docker env vars
- 01Open the container's config.php and confirm every domain is present
- 02Add missing entries manually if the env var only applied the first one
Did this fix it?
Symptoms
Opening Nextcloud shows 'Access through untrusted domain' or a redirect/encoding error, often after installing in Docker, TrueNAS or putting a reverse proxy in front.
Why it happens
- C-01The hostname or IP is missing from trusted_domains in config.php
- C-02Reverse proxy not listed in trusted_proxies
- C-03overwriteprotocol or overwritehost not set for the proxy
- C-04NEXTCLOUD_TRUSTED_DOMAINS env var applied only partly in a container
// this guide also covers
- nextcloud access through untrusted domain
- nextcloud trusted domain error
- nextcloud reverse proxy untrusted domain
Still not working?
If Nextcloud keeps failing, you're not alone. See every Nextcloud problem users report or the alternatives people switch to.
Have an app idea? Our small team builds any software: web and mobile apps, games, desktop, AI tools. Price agreed together.
Talk to usThe same problem in other apps
All not loading, error messages & connection guides →
Dropbox Upload Failed or Stuck on Waiting to Upload (Dropbox)
Why Is Proton Drive So Slow? Uploads and Downloads (Proton Drive)
Tresorit File Too Large to Upload (Tresorit)
Other Nextcloud errors
- Why Is Nextcloud So Slow?
- Nextcloud Upload Size Limit and 413 Error
- Nextcloud Desktop Client Sync Slow
- Nextcloud Sync Error: Connection Closed
- Nextcloud File Is Locked (423) Error
- Nextcloud Stuck in Maintenance Mode
- Nextcloud Internal Server Error After Update or App Install
- Nextcloud Client CSync Unknown Error