diff --git a/.config/reverse-proxy.config.php b/.config/reverse-proxy.config.php index 74046c17..667be312 100644 --- a/.config/reverse-proxy.config.php +++ b/.config/reverse-proxy.config.php @@ -2,34 +2,24 @@ $overwriteHost = getenv('OVERWRITEHOST'); if ($overwriteHost) { $CONFIG['overwritehost'] = $overwriteHost; -} else { - $CONFIG['overwritehost'] = null; } $overwriteProtocol = getenv('OVERWRITEPROTOCOL'); if ($overwriteProtocol) { $CONFIG['overwriteprotocol'] = $overwriteProtocol; -} else { - $CONFIG['overwriteprotocol'] = null; } $overwriteWebRoot = getenv('OVERWRITEWEBROOT'); if ($overwriteWebRoot) { $CONFIG['overwritewebroot'] = $overwriteWebRoot; -} else { - $CONFIG['overwritewebroot'] = null; } $overwriteCondAddr = getenv('OVERWRITECONDADDR'); if ($overwriteCondAddr) { $CONFIG['overwritecondaddr'] = $overwriteCondAddr; -} else { - $CONFIG['overwritecondaddr'] = null; } $trustedProxies = getenv('TRUSTED_PROXIES'); if ($trustedProxies) { $CONFIG['trusted_proxies'] = array_filter(array_map('trim', explode(' ', $trustedProxies))); -} else { - $CONFIG['trusted_proxies'] = null; } diff --git a/16.0/apache/config/reverse-proxy.config.php b/16.0/apache/config/reverse-proxy.config.php index 74046c17..667be312 100644 --- a/16.0/apache/config/reverse-proxy.config.php +++ b/16.0/apache/config/reverse-proxy.config.php @@ -2,34 +2,24 @@ $overwriteHost = getenv('OVERWRITEHOST'); if ($overwriteHost) { $CONFIG['overwritehost'] = $overwriteHost; -} else { - $CONFIG['overwritehost'] = null; } $overwriteProtocol = getenv('OVERWRITEPROTOCOL'); if ($overwriteProtocol) { $CONFIG['overwriteprotocol'] = $overwriteProtocol; -} else { - $CONFIG['overwriteprotocol'] = null; } $overwriteWebRoot = getenv('OVERWRITEWEBROOT'); if ($overwriteWebRoot) { $CONFIG['overwritewebroot'] = $overwriteWebRoot; -} else { - $CONFIG['overwritewebroot'] = null; } $overwriteCondAddr = getenv('OVERWRITECONDADDR'); if ($overwriteCondAddr) { $CONFIG['overwritecondaddr'] = $overwriteCondAddr; -} else { - $CONFIG['overwritecondaddr'] = null; } $trustedProxies = getenv('TRUSTED_PROXIES'); if ($trustedProxies) { $CONFIG['trusted_proxies'] = array_filter(array_map('trim', explode(' ', $trustedProxies))); -} else { - $CONFIG['trusted_proxies'] = null; } diff --git a/16.0/fpm-alpine/config/reverse-proxy.config.php b/16.0/fpm-alpine/config/reverse-proxy.config.php index 74046c17..667be312 100644 --- a/16.0/fpm-alpine/config/reverse-proxy.config.php +++ b/16.0/fpm-alpine/config/reverse-proxy.config.php @@ -2,34 +2,24 @@ $overwriteHost = getenv('OVERWRITEHOST'); if ($overwriteHost) { $CONFIG['overwritehost'] = $overwriteHost; -} else { - $CONFIG['overwritehost'] = null; } $overwriteProtocol = getenv('OVERWRITEPROTOCOL'); if ($overwriteProtocol) { $CONFIG['overwriteprotocol'] = $overwriteProtocol; -} else { - $CONFIG['overwriteprotocol'] = null; } $overwriteWebRoot = getenv('OVERWRITEWEBROOT'); if ($overwriteWebRoot) { $CONFIG['overwritewebroot'] = $overwriteWebRoot; -} else { - $CONFIG['overwritewebroot'] = null; } $overwriteCondAddr = getenv('OVERWRITECONDADDR'); if ($overwriteCondAddr) { $CONFIG['overwritecondaddr'] = $overwriteCondAddr; -} else { - $CONFIG['overwritecondaddr'] = null; } $trustedProxies = getenv('TRUSTED_PROXIES'); if ($trustedProxies) { $CONFIG['trusted_proxies'] = array_filter(array_map('trim', explode(' ', $trustedProxies))); -} else { - $CONFIG['trusted_proxies'] = null; } diff --git a/16.0/fpm/config/reverse-proxy.config.php b/16.0/fpm/config/reverse-proxy.config.php index 74046c17..667be312 100644 --- a/16.0/fpm/config/reverse-proxy.config.php +++ b/16.0/fpm/config/reverse-proxy.config.php @@ -2,34 +2,24 @@ $overwriteHost = getenv('OVERWRITEHOST'); if ($overwriteHost) { $CONFIG['overwritehost'] = $overwriteHost; -} else { - $CONFIG['overwritehost'] = null; } $overwriteProtocol = getenv('OVERWRITEPROTOCOL'); if ($overwriteProtocol) { $CONFIG['overwriteprotocol'] = $overwriteProtocol; -} else { - $CONFIG['overwriteprotocol'] = null; } $overwriteWebRoot = getenv('OVERWRITEWEBROOT'); if ($overwriteWebRoot) { $CONFIG['overwritewebroot'] = $overwriteWebRoot; -} else { - $CONFIG['overwritewebroot'] = null; } $overwriteCondAddr = getenv('OVERWRITECONDADDR'); if ($overwriteCondAddr) { $CONFIG['overwritecondaddr'] = $overwriteCondAddr; -} else { - $CONFIG['overwritecondaddr'] = null; } $trustedProxies = getenv('TRUSTED_PROXIES'); if ($trustedProxies) { $CONFIG['trusted_proxies'] = array_filter(array_map('trim', explode(' ', $trustedProxies))); -} else { - $CONFIG['trusted_proxies'] = null; } diff --git a/17.0/apache/config/reverse-proxy.config.php b/17.0/apache/config/reverse-proxy.config.php index 74046c17..667be312 100644 --- a/17.0/apache/config/reverse-proxy.config.php +++ b/17.0/apache/config/reverse-proxy.config.php @@ -2,34 +2,24 @@ $overwriteHost = getenv('OVERWRITEHOST'); if ($overwriteHost) { $CONFIG['overwritehost'] = $overwriteHost; -} else { - $CONFIG['overwritehost'] = null; } $overwriteProtocol = getenv('OVERWRITEPROTOCOL'); if ($overwriteProtocol) { $CONFIG['overwriteprotocol'] = $overwriteProtocol; -} else { - $CONFIG['overwriteprotocol'] = null; } $overwriteWebRoot = getenv('OVERWRITEWEBROOT'); if ($overwriteWebRoot) { $CONFIG['overwritewebroot'] = $overwriteWebRoot; -} else { - $CONFIG['overwritewebroot'] = null; } $overwriteCondAddr = getenv('OVERWRITECONDADDR'); if ($overwriteCondAddr) { $CONFIG['overwritecondaddr'] = $overwriteCondAddr; -} else { - $CONFIG['overwritecondaddr'] = null; } $trustedProxies = getenv('TRUSTED_PROXIES'); if ($trustedProxies) { $CONFIG['trusted_proxies'] = array_filter(array_map('trim', explode(' ', $trustedProxies))); -} else { - $CONFIG['trusted_proxies'] = null; } diff --git a/17.0/fpm-alpine/config/reverse-proxy.config.php b/17.0/fpm-alpine/config/reverse-proxy.config.php index 74046c17..667be312 100644 --- a/17.0/fpm-alpine/config/reverse-proxy.config.php +++ b/17.0/fpm-alpine/config/reverse-proxy.config.php @@ -2,34 +2,24 @@ $overwriteHost = getenv('OVERWRITEHOST'); if ($overwriteHost) { $CONFIG['overwritehost'] = $overwriteHost; -} else { - $CONFIG['overwritehost'] = null; } $overwriteProtocol = getenv('OVERWRITEPROTOCOL'); if ($overwriteProtocol) { $CONFIG['overwriteprotocol'] = $overwriteProtocol; -} else { - $CONFIG['overwriteprotocol'] = null; } $overwriteWebRoot = getenv('OVERWRITEWEBROOT'); if ($overwriteWebRoot) { $CONFIG['overwritewebroot'] = $overwriteWebRoot; -} else { - $CONFIG['overwritewebroot'] = null; } $overwriteCondAddr = getenv('OVERWRITECONDADDR'); if ($overwriteCondAddr) { $CONFIG['overwritecondaddr'] = $overwriteCondAddr; -} else { - $CONFIG['overwritecondaddr'] = null; } $trustedProxies = getenv('TRUSTED_PROXIES'); if ($trustedProxies) { $CONFIG['trusted_proxies'] = array_filter(array_map('trim', explode(' ', $trustedProxies))); -} else { - $CONFIG['trusted_proxies'] = null; } diff --git a/17.0/fpm/config/reverse-proxy.config.php b/17.0/fpm/config/reverse-proxy.config.php index 74046c17..667be312 100644 --- a/17.0/fpm/config/reverse-proxy.config.php +++ b/17.0/fpm/config/reverse-proxy.config.php @@ -2,34 +2,24 @@ $overwriteHost = getenv('OVERWRITEHOST'); if ($overwriteHost) { $CONFIG['overwritehost'] = $overwriteHost; -} else { - $CONFIG['overwritehost'] = null; } $overwriteProtocol = getenv('OVERWRITEPROTOCOL'); if ($overwriteProtocol) { $CONFIG['overwriteprotocol'] = $overwriteProtocol; -} else { - $CONFIG['overwriteprotocol'] = null; } $overwriteWebRoot = getenv('OVERWRITEWEBROOT'); if ($overwriteWebRoot) { $CONFIG['overwritewebroot'] = $overwriteWebRoot; -} else { - $CONFIG['overwritewebroot'] = null; } $overwriteCondAddr = getenv('OVERWRITECONDADDR'); if ($overwriteCondAddr) { $CONFIG['overwritecondaddr'] = $overwriteCondAddr; -} else { - $CONFIG['overwritecondaddr'] = null; } $trustedProxies = getenv('TRUSTED_PROXIES'); if ($trustedProxies) { $CONFIG['trusted_proxies'] = array_filter(array_map('trim', explode(' ', $trustedProxies))); -} else { - $CONFIG['trusted_proxies'] = null; } diff --git a/18.0/apache/config/reverse-proxy.config.php b/18.0/apache/config/reverse-proxy.config.php index 74046c17..667be312 100644 --- a/18.0/apache/config/reverse-proxy.config.php +++ b/18.0/apache/config/reverse-proxy.config.php @@ -2,34 +2,24 @@ $overwriteHost = getenv('OVERWRITEHOST'); if ($overwriteHost) { $CONFIG['overwritehost'] = $overwriteHost; -} else { - $CONFIG['overwritehost'] = null; } $overwriteProtocol = getenv('OVERWRITEPROTOCOL'); if ($overwriteProtocol) { $CONFIG['overwriteprotocol'] = $overwriteProtocol; -} else { - $CONFIG['overwriteprotocol'] = null; } $overwriteWebRoot = getenv('OVERWRITEWEBROOT'); if ($overwriteWebRoot) { $CONFIG['overwritewebroot'] = $overwriteWebRoot; -} else { - $CONFIG['overwritewebroot'] = null; } $overwriteCondAddr = getenv('OVERWRITECONDADDR'); if ($overwriteCondAddr) { $CONFIG['overwritecondaddr'] = $overwriteCondAddr; -} else { - $CONFIG['overwritecondaddr'] = null; } $trustedProxies = getenv('TRUSTED_PROXIES'); if ($trustedProxies) { $CONFIG['trusted_proxies'] = array_filter(array_map('trim', explode(' ', $trustedProxies))); -} else { - $CONFIG['trusted_proxies'] = null; } diff --git a/18.0/fpm-alpine/config/reverse-proxy.config.php b/18.0/fpm-alpine/config/reverse-proxy.config.php index 74046c17..667be312 100644 --- a/18.0/fpm-alpine/config/reverse-proxy.config.php +++ b/18.0/fpm-alpine/config/reverse-proxy.config.php @@ -2,34 +2,24 @@ $overwriteHost = getenv('OVERWRITEHOST'); if ($overwriteHost) { $CONFIG['overwritehost'] = $overwriteHost; -} else { - $CONFIG['overwritehost'] = null; } $overwriteProtocol = getenv('OVERWRITEPROTOCOL'); if ($overwriteProtocol) { $CONFIG['overwriteprotocol'] = $overwriteProtocol; -} else { - $CONFIG['overwriteprotocol'] = null; } $overwriteWebRoot = getenv('OVERWRITEWEBROOT'); if ($overwriteWebRoot) { $CONFIG['overwritewebroot'] = $overwriteWebRoot; -} else { - $CONFIG['overwritewebroot'] = null; } $overwriteCondAddr = getenv('OVERWRITECONDADDR'); if ($overwriteCondAddr) { $CONFIG['overwritecondaddr'] = $overwriteCondAddr; -} else { - $CONFIG['overwritecondaddr'] = null; } $trustedProxies = getenv('TRUSTED_PROXIES'); if ($trustedProxies) { $CONFIG['trusted_proxies'] = array_filter(array_map('trim', explode(' ', $trustedProxies))); -} else { - $CONFIG['trusted_proxies'] = null; } diff --git a/18.0/fpm/config/reverse-proxy.config.php b/18.0/fpm/config/reverse-proxy.config.php index 74046c17..667be312 100644 --- a/18.0/fpm/config/reverse-proxy.config.php +++ b/18.0/fpm/config/reverse-proxy.config.php @@ -2,34 +2,24 @@ $overwriteHost = getenv('OVERWRITEHOST'); if ($overwriteHost) { $CONFIG['overwritehost'] = $overwriteHost; -} else { - $CONFIG['overwritehost'] = null; } $overwriteProtocol = getenv('OVERWRITEPROTOCOL'); if ($overwriteProtocol) { $CONFIG['overwriteprotocol'] = $overwriteProtocol; -} else { - $CONFIG['overwriteprotocol'] = null; } $overwriteWebRoot = getenv('OVERWRITEWEBROOT'); if ($overwriteWebRoot) { $CONFIG['overwritewebroot'] = $overwriteWebRoot; -} else { - $CONFIG['overwritewebroot'] = null; } $overwriteCondAddr = getenv('OVERWRITECONDADDR'); if ($overwriteCondAddr) { $CONFIG['overwritecondaddr'] = $overwriteCondAddr; -} else { - $CONFIG['overwritecondaddr'] = null; } $trustedProxies = getenv('TRUSTED_PROXIES'); if ($trustedProxies) { $CONFIG['trusted_proxies'] = array_filter(array_map('trim', explode(' ', $trustedProxies))); -} else { - $CONFIG['trusted_proxies'] = null; } diff --git a/19.0-beta/apache/config/reverse-proxy.config.php b/19.0-beta/apache/config/reverse-proxy.config.php index 74046c17..667be312 100644 --- a/19.0-beta/apache/config/reverse-proxy.config.php +++ b/19.0-beta/apache/config/reverse-proxy.config.php @@ -2,34 +2,24 @@ $overwriteHost = getenv('OVERWRITEHOST'); if ($overwriteHost) { $CONFIG['overwritehost'] = $overwriteHost; -} else { - $CONFIG['overwritehost'] = null; } $overwriteProtocol = getenv('OVERWRITEPROTOCOL'); if ($overwriteProtocol) { $CONFIG['overwriteprotocol'] = $overwriteProtocol; -} else { - $CONFIG['overwriteprotocol'] = null; } $overwriteWebRoot = getenv('OVERWRITEWEBROOT'); if ($overwriteWebRoot) { $CONFIG['overwritewebroot'] = $overwriteWebRoot; -} else { - $CONFIG['overwritewebroot'] = null; } $overwriteCondAddr = getenv('OVERWRITECONDADDR'); if ($overwriteCondAddr) { $CONFIG['overwritecondaddr'] = $overwriteCondAddr; -} else { - $CONFIG['overwritecondaddr'] = null; } $trustedProxies = getenv('TRUSTED_PROXIES'); if ($trustedProxies) { $CONFIG['trusted_proxies'] = array_filter(array_map('trim', explode(' ', $trustedProxies))); -} else { - $CONFIG['trusted_proxies'] = null; } diff --git a/19.0-beta/fpm-alpine/config/reverse-proxy.config.php b/19.0-beta/fpm-alpine/config/reverse-proxy.config.php index 74046c17..667be312 100644 --- a/19.0-beta/fpm-alpine/config/reverse-proxy.config.php +++ b/19.0-beta/fpm-alpine/config/reverse-proxy.config.php @@ -2,34 +2,24 @@ $overwriteHost = getenv('OVERWRITEHOST'); if ($overwriteHost) { $CONFIG['overwritehost'] = $overwriteHost; -} else { - $CONFIG['overwritehost'] = null; } $overwriteProtocol = getenv('OVERWRITEPROTOCOL'); if ($overwriteProtocol) { $CONFIG['overwriteprotocol'] = $overwriteProtocol; -} else { - $CONFIG['overwriteprotocol'] = null; } $overwriteWebRoot = getenv('OVERWRITEWEBROOT'); if ($overwriteWebRoot) { $CONFIG['overwritewebroot'] = $overwriteWebRoot; -} else { - $CONFIG['overwritewebroot'] = null; } $overwriteCondAddr = getenv('OVERWRITECONDADDR'); if ($overwriteCondAddr) { $CONFIG['overwritecondaddr'] = $overwriteCondAddr; -} else { - $CONFIG['overwritecondaddr'] = null; } $trustedProxies = getenv('TRUSTED_PROXIES'); if ($trustedProxies) { $CONFIG['trusted_proxies'] = array_filter(array_map('trim', explode(' ', $trustedProxies))); -} else { - $CONFIG['trusted_proxies'] = null; } diff --git a/19.0-beta/fpm/config/reverse-proxy.config.php b/19.0-beta/fpm/config/reverse-proxy.config.php index 74046c17..667be312 100644 --- a/19.0-beta/fpm/config/reverse-proxy.config.php +++ b/19.0-beta/fpm/config/reverse-proxy.config.php @@ -2,34 +2,24 @@ $overwriteHost = getenv('OVERWRITEHOST'); if ($overwriteHost) { $CONFIG['overwritehost'] = $overwriteHost; -} else { - $CONFIG['overwritehost'] = null; } $overwriteProtocol = getenv('OVERWRITEPROTOCOL'); if ($overwriteProtocol) { $CONFIG['overwriteprotocol'] = $overwriteProtocol; -} else { - $CONFIG['overwriteprotocol'] = null; } $overwriteWebRoot = getenv('OVERWRITEWEBROOT'); if ($overwriteWebRoot) { $CONFIG['overwritewebroot'] = $overwriteWebRoot; -} else { - $CONFIG['overwritewebroot'] = null; } $overwriteCondAddr = getenv('OVERWRITECONDADDR'); if ($overwriteCondAddr) { $CONFIG['overwritecondaddr'] = $overwriteCondAddr; -} else { - $CONFIG['overwritecondaddr'] = null; } $trustedProxies = getenv('TRUSTED_PROXIES'); if ($trustedProxies) { $CONFIG['trusted_proxies'] = array_filter(array_map('trim', explode(' ', $trustedProxies))); -} else { - $CONFIG['trusted_proxies'] = null; } diff --git a/README.md b/README.md index 2b456187..431072aa 100644 --- a/README.md +++ b/README.md @@ -176,6 +176,8 @@ If the `TRUSTED_PROXIES` approach does not work for you, try using fixed values Check the [Nexcloud documentation](https://docs.nextcloud.com/server/latest/admin_manual/configuration_server/reverse_proxy_configuration.html) for more details. +Keep in mind that once set, removing these environment variables won't remove these values from the configuration file, due to how Nextcloud merges configuration files together. + # Running this image with docker-compose The easiest way to get a fully featured and functional setup is using a `docker-compose` file. There are too many different possibilities to setup your system, so here are only some examples of what you have to look for.