@@ -162,11 +162,11 @@ Pomerium
162162
163163Thanks to `@JeffMatson <https://github.com/JeffMatson >`_ for Pomerium example.
164164
165- Example
166- -------
165+ Examples
166+ --------
167167
168168Nextcloud behind a reverse proxy (subdirectory)
169- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
169+ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
170170
171171If 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