@@ -217,3 +217,34 @@ come from the proxy at **10.0.0.1**, which serves Nextcloud as
217217 the remote address matches. This is useful when the same Nextcloud instance is
218218 accessible both with and without a reverse proxy, or when different proxies
219219 serve the instance under different hostnames.
220+
221+ Multiple trusted domains and share link URLs
222+ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
223+
224+ When multiple entries are listed in ``trusted_domains ``, Nextcloud accepts
225+ requests on all of them and generates URLs based on the hostname of each
226+ incoming request. This means share links, download URLs, and notification
227+ links will reflect whichever hostname was used at the time they were copied.
228+
229+ A share link copied while accessing Nextcloud via an internal hostname
230+ (e.g. ``cloud.local ``) will contain that hostname and will not be reachable
231+ by users on a different network who only have access to the public hostname
232+ (e.g. ``cloud.example.com ``).
233+
234+ To ensure all generated URLs always use a single canonical hostname, set
235+ ``overwritehost `` and ``overwrite.cli.url `` unconditionally:
236+
237+ ::
238+
239+ <?php
240+ $CONFIG = array (
241+ 'trusted_domains' => ['cloud.local', 'cloud.example.com'],
242+ 'overwritehost' => 'cloud.example.com',
243+ 'overwriteprotocol' => 'https',
244+ 'overwrite.cli.url' => 'https://cloud.example.com',
245+ );
246+
247+ .. note :: Unlike the ``overwritecondaddr`` pattern above, this applies the
248+ overwrite to every request regardless of origin. Use this when you want
249+ one authoritative public URL for all generated links, even when the instance
250+ is also reachable internally under a different hostname.
0 commit comments