Nextcloud / Troubleshooting

Nextcloud Shows “Access through untrusted domain”

Confirm the exact Nextcloud untrusted-domain error on 34.0.3, compare the browser hostname with trusted_domains, and make only the narrow trusted-host change supported by the evidence.

Nextcloud 34.0.3 renders the exact heading “Access through untrusted domain” and points the administrator to the trusted_domains setting. The configuration reference describes trusted_domains as the list of hosts users may log into and states that the check protects against Host-header poisoning.[2][3]

trusted_domains is separate from trusted_proxies and overwritehost/overwriteprotocol. Those reverse-proxy settings solve different trust and URL-rewriting problems, so changing them does not belong in this diagnosis unless the observable error changes.[3][5]

Applicability

Products
Nextcloud
Scope
For Nextcloud Server 34.0.3 / the supported 34.x stable line when the web interface itself shows “Access through untrusted domain.” The tagged 34.0.3 template tells administrators to correct trusted_domains. This page does not cover TLS errors, DNS failures, trusted_proxies, overwrite* settings, or a generic reverse-proxy setup.[1][2][3]
Last verified

Symptoms

  • The browser reaches Nextcloud but the Nextcloud page stops at the exact “Access through untrusted domain” message. If the request never reaches Nextcloud, presents a certificate warning, or shows another proxy error, this page is out of scope.[2]

Quick diagnosis

Match the exact hostname to trusted_domains before changing any trust or reverse-proxy setting.

Read-only

Capture the exact hostname and port used in the browser

Record the browser hostname exactly as used, including a non-default port if one is present. Nextcloud supports exact hostnames, exact hostname-and-port entries, IP addresses, and limited wildcards in trusted_domains; do not normalize the observed value into a different host.[3]

Read-only

Read only the trusted_domains value

Use the supported occ config namespace to read trusted_domains without dumping unrelated private configuration. Compare the returned entries with the hostname that produced the error.[4][3]

occ config:system:get trusted_domains
Read-only

Keep proxy trust and URL rewriting out of this page

Do not add trusted_proxies, overwritehost, overwriteprotocol, or wildcard host trust merely because a reverse proxy exists. Those settings have different documented purposes and should be changed only under their own evidence.[5][3]

Interactive troubleshooter

Your answers stay in this browser tab. The tool does not connect to your systems or send diagnostic results.

Guided check / step 1

Safe diagnostic guidance

Is the page exactly “Access through untrusted domain”?

Use the tagged Nextcloud template as the scope gate. Other errors need a different diagnosis.[2]

Read the complete diagnostic tree without using the controls
  1. Is the page exactly “Access through untrusted domain”?

    Use the tagged Nextcloud template as the scope gate. Other errors need a different diagnosis.[2]

    • Yes — exact Nextcloud errorIs the exact browser host present in trusted_domains?
    • No — different errorDifferent diagnosis
  2. Is the exact browser host present in trusted_domains?

    Compare the exact hostname and optional port with the targeted trusted_domains output.[3][4]

    • No — the exact host is absentExact host is missing from trusted_domains
    • Yes — an exact-looking entry is presentDoes this hostname reach the intended Nextcloud instance?
    • Unsure — evidence is incompleteCollect evidence without changing trust
  3. Does this hostname reach the intended Nextcloud instance?

    Verify the backend identity before changing trust a second time. Proxy and DNS routing can send the same hostname elsewhere.[5]

    • Yes — intended instanceTrust list appears correct: inspect exact format before any change
    • No — different instance/backendThe hostname reaches a different backend
    • UnsureCollect evidence without changing trust
  4. Different diagnosis

    This page applies only to the exact Nextcloud untrusted-domain response.[2]

  5. Exact host is missing from trusted_domains

    Add only the proven hostname or hostname:port after preserving the current configuration; do not use unrestricted wildcard trust.[3][4]

  6. Trust list appears correct: inspect exact format before any change

    Re-check the accepted hostname and port forms and preserve the current list. If the parsed value truly matches, collect evidence instead of broadening trust.[3]

  7. The hostname reaches a different backend

    Correct the DNS/proxy routing under a separate procedure; do not expand trusted_domains on the wrong instance.[5]

  8. Collect evidence without changing trust

    Record the browser host, targeted trusted_domains output, and backend identity, then stop until the mismatch is known.[3][4][5]

Detailed diagnosis

Read-only

1. Verify the exact Nextcloud error

Confirm the response is the Nextcloud untrusted-domain page, not a TLS, DNS, web-server, or reverse-proxy error. The tagged template is the scope gate for this diagnosis.[2]

Read-only

2. Compare the request host with trusted_domains

Read trusted_domains and compare each entry with the browser hostname and port. If the observed host is absent, the evidence selects the missing-host branch. If it appears present, inspect exact formatting and the possibility that the request is reaching a different Nextcloud instance before editing anything.[3][4]

Read-only

3. If the host looks present, check format and destination

Confirm that the entry matches the exact hostname form accepted by Nextcloud, including any explicit port. If the list is correct, verify that DNS and the reverse proxy actually deliver this hostname to the intended Nextcloud instance; a different backend can have a different trusted_domains list.[3][5]

Read-only

4. Preserve the current configuration before mutation

Record the current trusted_domains list and preserve a restorable configuration state. Do not place ad-hoc backup files ending in .config.php inside the active config directory because Nextcloud can load additional *.config.php files and let them override config.php.[3]

Supported scenarios

These observations narrow the next investigation; they do not establish a unique cause.

The request hostname is not in trusted_domains

Nextcloud rejects a host that is not allowed by trusted_domains. This is the direct cause when the exact browser hostname is absent from the parsed list.[3][2]

How to check: Compare the exact host and optional port from the browser with the output of the targeted trusted_domains read.[3][2]

The trusted_domains entry does not exactly match the request

An entry can look similar while differing by hostname, IP literal, or explicit port. Nextcloud documents these forms separately.[3]

How to check: Check the exact hostname and port against the accepted trusted_domains forms.[3]

The hostname reaches a different Nextcloud instance

When the local trusted_domains list appears correct but the same error remains, a proxy or DNS path may be delivering the request to another instance with different configuration. That is a routing observation, not permission to broaden host trust.[5][3]

How to check: Verify the request destination and backend identity before any second trusted_domains change.[5][3]

Next actions and procedure boundaries

Potentially disruptive

Add only the exact required host to trusted_domains

After proving the host is absent, add the exact hostname or hostname:port that users actually need. Prefer the supported occ config:system:set mechanism or an equally controlled config-management path. Do not use '*' as a normal fix and do not remove the trusted-domain check.[4][3]

Before changing anything

Risk
Changing trusted_domains alters an access-control boundary. A wrong value can keep the instance inaccessible or broaden accepted Host headers.[3][4]
Safer check
Record the exact failing hostname, the current trusted_domains list, and a restorable configuration state before changing one entry.[3][4]
Expected result
The same hostname that previously showed the untrusted-domain page opens the intended Nextcloud instance, while existing trusted hostnames continue to work.[3][4]
Backup / recovery access
Preserve the current trusted_domains list and a restorable copy of the active configuration outside any location where an extra *.config.php file would be loaded.[3][4]
Rollback
Restore the recorded trusted_domains list if the intended hostname does not recover or another trusted hostname stops working.[3][4]
Potentially disruptive

Correct a proven hostname or port mismatch

If the intended host is present only in the wrong form, change that single entry to the exact hostname or hostname:port required by the documented trusted_domains format. Do not add proxy trust or overwrite settings as a substitute.[3]

Before changing anything

Risk
Replacing a trusted host entry can immediately affect every client using that entry.[3]
Safer check
Confirm the mismatch from the exact browser host and preserve the previous list before editing.[3]
Expected result
The intended hostname works and any previously required hostname that should remain trusted is still represented correctly.[3]
Backup / recovery access
Keep the prior list and active configuration available for restoration.[3]
Rollback
Restore the previous entry if the corrected host still fails or a required existing access path breaks.[3]
Read-only

If the list is correct, stop changing trust and verify routing

When the exact host is already trusted, keep the trust list unchanged and hand off the observed hostname, backend identity, DNS result, and reverse-proxy route to the operator. trusted_proxies and overwrite* settings belong to separate diagnoses unless new evidence selects them.[5][3]

Warnings and boundaries

Do not solve this error by removing trusted-domain protection or by trusting every host. The protection exists specifically to prevent Host-header poisoning.[3]

Sources

Links were reviewed on 2026-09-08. Reachability and automated validation do not replace editorial verification of each claim.

  1. Nextcloud Server v34.0.3 release
    Nextcloud GmbH · Tier B · accessed 2026-09-08
  2. Nextcloud 34.0.3 untrusted-domain template
    Nextcloud GmbH · Tier B · accessed 2026-09-08
  3. Nextcloud 34 configuration parameters
    Nextcloud GmbH · Tier A · accessed 2026-09-08
  4. Using the occ command
    Nextcloud GmbH · Tier A · accessed 2026-09-08
  5. Reverse proxy configuration
    Nextcloud GmbH · Tier A · accessed 2026-09-08