Skip to content

Commit b8483df

Browse files
Add second example for overwritecondaddr (multiple domains / conditional overwrite)
Agent-Logs-Url: https://github.com/nextcloud/documentation/sessions/890e2c66-1b33-4c4a-ab4d-76db40908e7d Co-authored-by: nextcloud-command <88102737+nextcloud-command@users.noreply.github.com>
1 parent 1ba67a7 commit b8483df

1 file changed

Lines changed: 33 additions & 3 deletions

File tree

‎admin_manual/configuration_server/reverse_proxy_configuration.rst‎

Lines changed: 33 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -162,11 +162,11 @@ Pomerium
162162

163163
Thanks to `@JeffMatson <https://github.com/JeffMatson>`_ for Pomerium example.
164164

165-
Example
166-
-------
165+
Examples
166+
--------
167167

168168
Nextcloud behind a reverse proxy (subdirectory)
169-
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
169+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
170170

171171
If your Nextcloud is served at a subdirectory, for example
172172
**https://example.com/nextcloud**, behind a reverse proxy with IP address
@@ -187,3 +187,33 @@ If your Nextcloud is served at a subdirectory, for example
187187
the hostname from the ``Host`` header forwarded by the proxy. Only set it if
188188
you need to force a specific hostname regardless of the incoming request.
189189
Leave any parameter unset or empty to keep the automatic detection.
190+
191+
Nextcloud accessible via multiple domains / conditional overwrite
192+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
193+
194+
If Nextcloud is reachable both directly (HTTP) and through a reverse proxy
195+
(HTTPS), or through multiple proxies serving different public domains, use
196+
``overwritecondaddr`` to apply the overwrite parameters only when requests
197+
arrive from a specific proxy IP address. Requests that do not originate from
198+
that proxy will use automatic detection.
199+
200+
In the example below, the overwrite parameters are applied only when requests
201+
come from the proxy at **10.0.0.1**, which serves Nextcloud as
202+
**https://public.example.com**:
203+
204+
::
205+
206+
<?php
207+
$CONFIG = array (
208+
'trusted_proxies' => ['10.0.0.1'],
209+
'overwritehost' => 'public.example.com',
210+
'overwriteprotocol' => 'https',
211+
'overwritecondaddr' => '^10\.0\.0\.1$',
212+
'overwrite.cli.url' => 'https://public.example.com',
213+
);
214+
215+
.. note:: ``overwritecondaddr`` takes a regular expression matching the remote
216+
address of the proxy. When set, the overwrite parameters are only applied if
217+
the remote address matches. This is useful when the same Nextcloud instance is
218+
accessible both with and without a reverse proxy, or when different proxies
219+
serve the instance under different hostnames.

0 commit comments

Comments
 (0)