Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clarify trusted_domains setting #12003

Open
joshtrichards opened this issue Jul 11, 2024 · 0 comments
Open

Clarify trusted_domains setting #12003

joshtrichards opened this issue Jul 11, 2024 · 0 comments

Comments

@joshtrichards
Copy link
Member

          > It does, however, run a check against each of your configured `trusted_domains` [...]

If one of the listed domains returns a 200 code, that error will appear. [...]
Usually this is when people discover they have many unnecessary domains in their config [...]

You were right. That was the culprit.

I am using virtual hosting with several sub-domains on a single Apache server with the same IP address. One sub-domain is cloud.my-domain.tld (for NC), photos.my-domain.tld (for Lychee) and www.my-domain.tld (which only serves an imprint and other required legal information).

I had the following entries for trusted_domains:

'trusted_domains' => array (
  0 => 'localhost',
  1 => '127.0.0.1',
  2 => '[::1]',
  3 => '<my-public-IPv4-address>',
  4 => '<my-public-IPv6-address>',
  5 => 'cloud.my-domain.tld',
),

localhost and 127.0.0.1 had been listed by default and I added [::1] as well as my public IP addresses. However, if a client connected to any of those, the Apache server redirect the request to the default sub-domain www.my-domain.tld which serves the imprint. I removed every entry but the last one. Now the error disappeared again.

Maybe there should be an explicit hint at NC Admin Manual: Configuration Parameters - Trusted Domains that for virtual hosting only the proper domain should be listed. In particular, with virtual hosting the default entries localhost and 127.0.0.1 must be removed.

Originally posted by @nagmat84 in nextcloud/server#46381 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant