summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrás Maróy <andras@maroy.hu>2020-04-16 17:54:48 +0200
committerGitHub <noreply@github.com>2020-04-16 15:54:48 +0000
commit6d2390726fe7110b406c447d48aa345fc9d07122 (patch)
tree9c2c9976d731baafc64bc16dfdd376b9c515026b
parent815298f5deea7796cf7968b61647606cdd8c8178 (diff)
* Expose reverse proxy related configuration as environment variables Signed-off-by: András Maróy <andras@maroy.hu> * Update README.md Co-Authored-By: J0WI <J0WI@users.noreply.github.com> Signed-off-by: András Maróy <andras@maroy.hu> * Update README.md Co-Authored-By: J0WI <J0WI@users.noreply.github.com> Signed-off-by: András Maróy <andras@maroy.hu> * Add default values for reverse proxy config from environment Signed-off-by: András Maróy <andras@maroy.hu> * Change reverse proxy default values to null Signed-off-by: András Maróy <andras@maroy.hu> * Store environment variables in vars in reverse-proxy config Signed-off-by: András Maróy <andras@maroy.hu> * Merge reverse proxy configs Signed-off-by: András Maróy <andras@maroy.hu> * Move overwrite parameters to reverse proxy section in the readme Signed-off-by: András Maróy <andras@maroy.hu> * Add reverse proxy config to 19.0-beta images Signed-off-by: András Maróy <andras@maroy.hu> * Remove default null from reverse proxy config to avoid breaking existing deployments Signed-off-by: András Maróy <andras@maroy.hu> Co-authored-by: J0WI <J0WI@users.noreply.github.com>
-rw-r--r--.config/reverse-proxy.config.php25
-rw-r--r--.config/reverse_proxy.config.php11
-rw-r--r--16.0/apache/config/reverse-proxy.config.php25
-rw-r--r--16.0/apache/config/reverse_proxy.config.php11
-rw-r--r--16.0/fpm-alpine/config/reverse-proxy.config.php25
-rw-r--r--16.0/fpm-alpine/config/reverse_proxy.config.php11
-rw-r--r--16.0/fpm/config/reverse-proxy.config.php25
-rw-r--r--16.0/fpm/config/reverse_proxy.config.php11
-rw-r--r--17.0/apache/config/reverse-proxy.config.php25
-rw-r--r--17.0/apache/config/reverse_proxy.config.php11
-rw-r--r--17.0/fpm-alpine/config/reverse-proxy.config.php25
-rw-r--r--17.0/fpm-alpine/config/reverse_proxy.config.php11
-rw-r--r--17.0/fpm/config/reverse-proxy.config.php25
-rw-r--r--17.0/fpm/config/reverse_proxy.config.php11
-rw-r--r--18.0/apache/config/reverse-proxy.config.php25
-rw-r--r--18.0/apache/config/reverse_proxy.config.php11
-rw-r--r--18.0/fpm-alpine/config/reverse-proxy.config.php25
-rw-r--r--18.0/fpm-alpine/config/reverse_proxy.config.php11
-rw-r--r--18.0/fpm/config/reverse-proxy.config.php25
-rw-r--r--18.0/fpm/config/reverse_proxy.config.php11
-rw-r--r--19.0-beta/apache/config/reverse-proxy.config.php25
-rw-r--r--19.0-beta/apache/config/reverse_proxy.config.php11
-rw-r--r--19.0-beta/fpm-alpine/config/reverse-proxy.config.php25
-rw-r--r--19.0-beta/fpm-alpine/config/reverse_proxy.config.php11
-rw-r--r--19.0-beta/fpm/config/reverse-proxy.config.php25
-rw-r--r--19.0-beta/fpm/config/reverse_proxy.config.php11
-rw-r--r--README.md14
27 files changed, 338 insertions, 144 deletions
diff --git a/.config/reverse-proxy.config.php b/.config/reverse-proxy.config.php
new file mode 100644
index 00000000..667be312
--- /dev/null
+++ b/.config/reverse-proxy.config.php
@@ -0,0 +1,25 @@
+<?php
+$overwriteHost = getenv('OVERWRITEHOST');
+if ($overwriteHost) {
+ $CONFIG['overwritehost'] = $overwriteHost;
+}
+
+$overwriteProtocol = getenv('OVERWRITEPROTOCOL');
+if ($overwriteProtocol) {
+ $CONFIG['overwriteprotocol'] = $overwriteProtocol;
+}
+
+$overwriteWebRoot = getenv('OVERWRITEWEBROOT');
+if ($overwriteWebRoot) {
+ $CONFIG['overwritewebroot'] = $overwriteWebRoot;
+}
+
+$overwriteCondAddr = getenv('OVERWRITECONDADDR');
+if ($overwriteCondAddr) {
+ $CONFIG['overwritecondaddr'] = $overwriteCondAddr;
+}
+
+$trustedProxies = getenv('TRUSTED_PROXIES');
+if ($trustedProxies) {
+ $CONFIG['trusted_proxies'] = array_filter(array_map('trim', explode(' ', $trustedProxies)));
+}
diff --git a/.config/reverse_proxy.config.php b/.config/reverse_proxy.config.php
deleted file mode 100644
index 26a8bff3..00000000
--- a/.config/reverse_proxy.config.php
+++ /dev/null
@@ -1,11 +0,0 @@
-<?php
-
-$trustedProxies = getenv('TRUSTED_PROXIES');
-
-if ($trustedProxies) {
- $trustedProxies = array_filter(array_map('trim', explode(' ', $trustedProxies)));
-} else {
- $trustedProxies = null;
-}
-
-$CONFIG['trusted_proxies'] = $trustedProxies; \ No newline at end of file
diff --git a/16.0/apache/config/reverse-proxy.config.php b/16.0/apache/config/reverse-proxy.config.php
new file mode 100644
index 00000000..667be312
--- /dev/null
+++ b/16.0/apache/config/reverse-proxy.config.php
@@ -0,0 +1,25 @@
+<?php
+$overwriteHost = getenv('OVERWRITEHOST');
+if ($overwriteHost) {
+ $CONFIG['overwritehost'] = $overwriteHost;
+}
+
+$overwriteProtocol = getenv('OVERWRITEPROTOCOL');
+if ($overwriteProtocol) {
+ $CONFIG['overwriteprotocol'] = $overwriteProtocol;
+}
+
+$overwriteWebRoot = getenv('OVERWRITEWEBROOT');
+if ($overwriteWebRoot) {
+ $CONFIG['overwritewebroot'] = $overwriteWebRoot;
+}
+
+$overwriteCondAddr = getenv('OVERWRITECONDADDR');
+if ($overwriteCondAddr) {
+ $CONFIG['overwritecondaddr'] = $overwriteCondAddr;
+}
+
+$trustedProxies = getenv('TRUSTED_PROXIES');
+if ($trustedProxies) {
+ $CONFIG['trusted_proxies'] = array_filter(array_map('trim', explode(' ', $trustedProxies)));
+}
diff --git a/16.0/apache/config/reverse_proxy.config.php b/16.0/apache/config/reverse_proxy.config.php
deleted file mode 100644
index 26a8bff3..00000000
--- a/16.0/apache/config/reverse_proxy.config.php
+++ /dev/null
@@ -1,11 +0,0 @@
-<?php
-
-$trustedProxies = getenv('TRUSTED_PROXIES');
-
-if ($trustedProxies) {
- $trustedProxies = array_filter(array_map('trim', explode(' ', $trustedProxies)));
-} else {
- $trustedProxies = null;
-}
-
-$CONFIG['trusted_proxies'] = $trustedProxies; \ No newline at end of file
diff --git a/16.0/fpm-alpine/config/reverse-proxy.config.php b/16.0/fpm-alpine/config/reverse-proxy.config.php
new file mode 100644
index 00000000..667be312
--- /dev/null
+++ b/16.0/fpm-alpine/config/reverse-proxy.config.php
@@ -0,0 +1,25 @@
+<?php
+$overwriteHost = getenv('OVERWRITEHOST');
+if ($overwriteHost) {
+ $CONFIG['overwritehost'] = $overwriteHost;
+}
+
+$overwriteProtocol = getenv('OVERWRITEPROTOCOL');
+if ($overwriteProtocol) {
+ $CONFIG['overwriteprotocol'] = $overwriteProtocol;
+}
+
+$overwriteWebRoot = getenv('OVERWRITEWEBROOT');
+if ($overwriteWebRoot) {
+ $CONFIG['overwritewebroot'] = $overwriteWebRoot;
+}
+
+$overwriteCondAddr = getenv('OVERWRITECONDADDR');
+if ($overwriteCondAddr) {
+ $CONFIG['overwritecondaddr'] = $overwriteCondAddr;
+}
+
+$trustedProxies = getenv('TRUSTED_PROXIES');
+if ($trustedProxies) {
+ $CONFIG['trusted_proxies'] = array_filter(array_map('trim', explode(' ', $trustedProxies)));
+}
diff --git a/16.0/fpm-alpine/config/reverse_proxy.config.php b/16.0/fpm-alpine/config/reverse_proxy.config.php
deleted file mode 100644
index 26a8bff3..00000000
--- a/16.0/fpm-alpine/config/reverse_proxy.config.php
+++ /dev/null
@@ -1,11 +0,0 @@
-<?php
-
-$trustedProxies = getenv('TRUSTED_PROXIES');
-
-if ($trustedProxies) {
- $trustedProxies = array_filter(array_map('trim', explode(' ', $trustedProxies)));
-} else {
- $trustedProxies = null;
-}
-
-$CONFIG['trusted_proxies'] = $trustedProxies; \ No newline at end of file
diff --git a/16.0/fpm/config/reverse-proxy.config.php b/16.0/fpm/config/reverse-proxy.config.php
new file mode 100644
index 00000000..667be312
--- /dev/null
+++ b/16.0/fpm/config/reverse-proxy.config.php
@@ -0,0 +1,25 @@
+<?php
+$overwriteHost = getenv('OVERWRITEHOST');
+if ($overwriteHost) {
+ $CONFIG['overwritehost'] = $overwriteHost;
+}
+
+$overwriteProtocol = getenv('OVERWRITEPROTOCOL');
+if ($overwriteProtocol) {
+ $CONFIG['overwriteprotocol'] = $overwriteProtocol;
+}
+
+$overwriteWebRoot = getenv('OVERWRITEWEBROOT');
+if ($overwriteWebRoot) {
+ $CONFIG['overwritewebroot'] = $overwriteWebRoot;
+}
+
+$overwriteCondAddr = getenv('OVERWRITECONDADDR');
+if ($overwriteCondAddr) {
+ $CONFIG['overwritecondaddr'] = $overwriteCondAddr;
+}
+
+$trustedProxies = getenv('TRUSTED_PROXIES');
+if ($trustedProxies) {
+ $CONFIG['trusted_proxies'] = array_filter(array_map('trim', explode(' ', $trustedProxies)));
+}
diff --git a/16.0/fpm/config/reverse_proxy.config.php b/16.0/fpm/config/reverse_proxy.config.php
deleted file mode 100644
index 26a8bff3..00000000
--- a/16.0/fpm/config/reverse_proxy.config.php
+++ /dev/null
@@ -1,11 +0,0 @@
-<?php
-
-$trustedProxies = getenv('TRUSTED_PROXIES');
-
-if ($trustedProxies) {
- $trustedProxies = array_filter(array_map('trim', explode(' ', $trustedProxies)));
-} else {
- $trustedProxies = null;
-}
-
-$CONFIG['trusted_proxies'] = $trustedProxies; \ No newline at end of file
diff --git a/17.0/apache/config/reverse-proxy.config.php b/17.0/apache/config/reverse-proxy.config.php
new file mode 100644
index 00000000..667be312
--- /dev/null
+++ b/17.0/apache/config/reverse-proxy.config.php
@@ -0,0 +1,25 @@
+<?php
+$overwriteHost = getenv('OVERWRITEHOST');
+if ($overwriteHost) {
+ $CONFIG['overwritehost'] = $overwriteHost;
+}
+
+$overwriteProtocol = getenv('OVERWRITEPROTOCOL');
+if ($overwriteProtocol) {
+ $CONFIG['overwriteprotocol'] = $overwriteProtocol;
+}
+
+$overwriteWebRoot = getenv('OVERWRITEWEBROOT');
+if ($overwriteWebRoot) {
+ $CONFIG['overwritewebroot'] = $overwriteWebRoot;
+}
+
+$overwriteCondAddr = getenv('OVERWRITECONDADDR');
+if ($overwriteCondAddr) {
+ $CONFIG['overwritecondaddr'] = $overwriteCondAddr;
+}
+
+$trustedProxies = getenv('TRUSTED_PROXIES');
+if ($trustedProxies) {
+ $CONFIG['trusted_proxies'] = array_filter(array_map('trim', explode(' ', $trustedProxies)));
+}
diff --git a/17.0/apache/config/reverse_proxy.config.php b/17.0/apache/config/reverse_proxy.config.php
deleted file mode 100644
index 26a8bff3..00000000
--- a/17.0/apache/config/reverse_proxy.config.php
+++ /dev/null
@@ -1,11 +0,0 @@
-<?php
-
-$trustedProxies = getenv('TRUSTED_PROXIES');
-
-if ($trustedProxies) {
- $trustedProxies = array_filter(array_map('trim', explode(' ', $trustedProxies)));
-} else {
- $trustedProxies = null;
-}
-
-$CONFIG['trusted_proxies'] = $trustedProxies; \ No newline at end of file
diff --git a/17.0/fpm-alpine/config/reverse-proxy.config.php b/17.0/fpm-alpine/config/reverse-proxy.config.php
new file mode 100644
index 00000000..667be312
--- /dev/null
+++ b/17.0/fpm-alpine/config/reverse-proxy.config.php
@@ -0,0 +1,25 @@
+<?php
+$overwriteHost = getenv('OVERWRITEHOST');
+if ($overwriteHost) {
+ $CONFIG['overwritehost'] = $overwriteHost;
+}
+
+$overwriteProtocol = getenv('OVERWRITEPROTOCOL');
+if ($overwriteProtocol) {
+ $CONFIG['overwriteprotocol'] = $overwriteProtocol;
+}
+
+$overwriteWebRoot = getenv('OVERWRITEWEBROOT');
+if ($overwriteWebRoot) {
+ $CONFIG['overwritewebroot'] = $overwriteWebRoot;
+}
+
+$overwriteCondAddr = getenv('OVERWRITECONDADDR');
+if ($overwriteCondAddr) {
+ $CONFIG['overwritecondaddr'] = $overwriteCondAddr;
+}
+
+$trustedProxies = getenv('TRUSTED_PROXIES');
+if ($trustedProxies) {
+ $CONFIG['trusted_proxies'] = array_filter(array_map('trim', explode(' ', $trustedProxies)));
+}
diff --git a/17.0/fpm-alpine/config/reverse_proxy.config.php b/17.0/fpm-alpine/config/reverse_proxy.config.php
deleted file mode 100644
index 26a8bff3..00000000
--- a/17.0/fpm-alpine/config/reverse_proxy.config.php
+++ /dev/null
@@ -1,11 +0,0 @@
-<?php
-
-$trustedProxies = getenv('TRUSTED_PROXIES');
-
-if ($trustedProxies) {
- $trustedProxies = array_filter(array_map('trim', explode(' ', $trustedProxies)));
-} else {
- $trustedProxies = null;
-}
-
-$CONFIG['trusted_proxies'] = $trustedProxies; \ No newline at end of file
diff --git a/17.0/fpm/config/reverse-proxy.config.php b/17.0/fpm/config/reverse-proxy.config.php
new file mode 100644
index 00000000..667be312
--- /dev/null
+++ b/17.0/fpm/config/reverse-proxy.config.php
@@ -0,0 +1,25 @@
+<?php
+$overwriteHost = getenv('OVERWRITEHOST');
+if ($overwriteHost) {
+ $CONFIG['overwritehost'] = $overwriteHost;
+}
+
+$overwriteProtocol = getenv('OVERWRITEPROTOCOL');
+if ($overwriteProtocol) {
+ $CONFIG['overwriteprotocol'] = $overwriteProtocol;
+}
+
+$overwriteWebRoot = getenv('OVERWRITEWEBROOT');
+if ($overwriteWebRoot) {
+ $CONFIG['overwritewebroot'] = $overwriteWebRoot;
+}
+
+$overwriteCondAddr = getenv('OVERWRITECONDADDR');
+if ($overwriteCondAddr) {
+ $CONFIG['overwritecondaddr'] = $overwriteCondAddr;
+}
+
+$trustedProxies = getenv('TRUSTED_PROXIES');
+if ($trustedProxies) {
+ $CONFIG['trusted_proxies'] = array_filter(array_map('trim', explode(' ', $trustedProxies)));
+}
diff --git a/17.0/fpm/config/reverse_proxy.config.php b/17.0/fpm/config/reverse_proxy.config.php
deleted file mode 100644
index 26a8bff3..00000000
--- a/17.0/fpm/config/reverse_proxy.config.php
+++ /dev/null
@@ -1,11 +0,0 @@
-<?php
-
-$trustedProxies = getenv('TRUSTED_PROXIES');
-
-if ($trustedProxies) {
- $trustedProxies = array_filter(array_map('trim', explode(' ', $trustedProxies)));
-} else {
- $trustedProxies = null;
-}
-
-$CONFIG['trusted_proxies'] = $trustedProxies; \ No newline at end of file
diff --git a/18.0/apache/config/reverse-proxy.config.php b/18.0/apache/config/reverse-proxy.config.php
new file mode 100644
index 00000000..667be312
--- /dev/null
+++ b/18.0/apache/config/reverse-proxy.config.php
@@ -0,0 +1,25 @@
+<?php
+$overwriteHost = getenv('OVERWRITEHOST');
+if ($overwriteHost) {
+ $CONFIG['overwritehost'] = $overwriteHost;
+}
+
+$overwriteProtocol = getenv('OVERWRITEPROTOCOL');
+if ($overwriteProtocol) {
+ $CONFIG['overwriteprotocol'] = $overwriteProtocol;
+}
+
+$overwriteWebRoot = getenv('OVERWRITEWEBROOT');
+if ($overwriteWebRoot) {
+ $CONFIG['overwritewebroot'] = $overwriteWebRoot;
+}
+
+$overwriteCondAddr = getenv('OVERWRITECONDADDR');
+if ($overwriteCondAddr) {
+ $CONFIG['overwritecondaddr'] = $overwriteCondAddr;
+}
+
+$trustedProxies = getenv('TRUSTED_PROXIES');
+if ($trustedProxies) {
+ $CONFIG['trusted_proxies'] = array_filter(array_map('trim', explode(' ', $trustedProxies)));
+}
diff --git a/18.0/apache/config/reverse_proxy.config.php b/18.0/apache/config/reverse_proxy.config.php
deleted file mode 100644
index 26a8bff3..00000000
--- a/18.0/apache/config/reverse_proxy.config.php
+++ /dev/null
@@ -1,11 +0,0 @@
-<?php
-
-$trustedProxies = getenv('TRUSTED_PROXIES');
-
-if ($trustedProxies) {
- $trustedProxies = array_filter(array_map('trim', explode(' ', $trustedProxies)));
-} else {
- $trustedProxies = null;
-}
-
-$CONFIG['trusted_proxies'] = $trustedProxies; \ No newline at end of file
diff --git a/18.0/fpm-alpine/config/reverse-proxy.config.php b/18.0/fpm-alpine/config/reverse-proxy.config.php
new file mode 100644
index 00000000..667be312
--- /dev/null
+++ b/18.0/fpm-alpine/config/reverse-proxy.config.php
@@ -0,0 +1,25 @@
+<?php
+$overwriteHost = getenv('OVERWRITEHOST');
+if ($overwriteHost) {
+ $CONFIG['overwritehost'] = $overwriteHost;
+}
+
+$overwriteProtocol = getenv('OVERWRITEPROTOCOL');
+if ($overwriteProtocol) {
+ $CONFIG['overwriteprotocol'] = $overwriteProtocol;
+}
+
+$overwriteWebRoot = getenv('OVERWRITEWEBROOT');
+if ($overwriteWebRoot) {
+ $CONFIG['overwritewebroot'] = $overwriteWebRoot;
+}
+
+$overwriteCondAddr = getenv('OVERWRITECONDADDR');
+if ($overwriteCondAddr) {
+ $CONFIG['overwritecondaddr'] = $overwriteCondAddr;
+}
+
+$trustedProxies = getenv('TRUSTED_PROXIES');
+if ($trustedProxies) {
+ $CONFIG['trusted_proxies'] = array_filter(array_map('trim', explode(' ', $trustedProxies)));
+}
diff --git a/18.0/fpm-alpine/config/reverse_proxy.config.php b/18.0/fpm-alpine/config/reverse_proxy.config.php
deleted file mode 100644
index 26a8bff3..00000000
--- a/18.0/fpm-alpine/config/reverse_proxy.config.php
+++ /dev/null
@@ -1,11 +0,0 @@
-<?php
-
-$trustedProxies = getenv('TRUSTED_PROXIES');
-
-if ($trustedProxies) {
- $trustedProxies = array_filter(array_map('trim', explode(' ', $trustedProxies)));
-} else {
- $trustedProxies = null;
-}
-
-$CONFIG['trusted_proxies'] = $trustedProxies; \ No newline at end of file
diff --git a/18.0/fpm/config/reverse-proxy.config.php b/18.0/fpm/config/reverse-proxy.config.php
new file mode 100644
index 00000000..667be312
--- /dev/null
+++ b/18.0/fpm/config/reverse-proxy.config.php
@@ -0,0 +1,25 @@
+<?php
+$overwriteHost = getenv('OVERWRITEHOST');
+if ($overwriteHost) {
+ $CONFIG['overwritehost'] = $overwriteHost;
+}
+
+$overwriteProtocol = getenv('OVERWRITEPROTOCOL');
+if ($overwriteProtocol) {
+ $CONFIG['overwriteprotocol'] = $overwriteProtocol;
+}
+
+$overwriteWebRoot = getenv('OVERWRITEWEBROOT');
+if ($overwriteWebRoot) {
+ $CONFIG['overwritewebroot'] = $overwriteWebRoot;
+}
+
+$overwriteCondAddr = getenv('OVERWRITECONDADDR');
+if ($overwriteCondAddr) {
+ $CONFIG['overwritecondaddr'] = $overwriteCondAddr;
+}
+
+$trustedProxies = getenv('TRUSTED_PROXIES');
+if ($trustedProxies) {
+ $CONFIG['trusted_proxies'] = array_filter(array_map('trim', explode(' ', $trustedProxies)));
+}
diff --git a/18.0/fpm/config/reverse_proxy.config.php b/18.0/fpm/config/reverse_proxy.config.php
deleted file mode 100644
index 26a8bff3..00000000
--- a/18.0/fpm/config/reverse_proxy.config.php
+++ /dev/null
@@ -1,11 +0,0 @@
-<?php
-
-$trustedProxies = getenv('TRUSTED_PROXIES');
-
-if ($trustedProxies) {
- $trustedProxies = array_filter(array_map('trim', explode(' ', $trustedProxies)));
-} else {
- $trustedProxies = null;
-}
-
-$CONFIG['trusted_proxies'] = $trustedProxies; \ No newline at end of file
diff --git a/19.0-beta/apache/config/reverse-proxy.config.php b/19.0-beta/apache/config/reverse-proxy.config.php
new file mode 100644
index 00000000..667be312
--- /dev/null
+++ b/19.0-beta/apache/config/reverse-proxy.config.php
@@ -0,0 +1,25 @@
+<?php
+$overwriteHost = getenv('OVERWRITEHOST');
+if ($overwriteHost) {
+ $CONFIG['overwritehost'] = $overwriteHost;
+}
+
+$overwriteProtocol = getenv('OVERWRITEPROTOCOL');
+if ($overwriteProtocol) {
+ $CONFIG['overwriteprotocol'] = $overwriteProtocol;
+}
+
+$overwriteWebRoot = getenv('OVERWRITEWEBROOT');
+if ($overwriteWebRoot) {
+ $CONFIG['overwritewebroot'] = $overwriteWebRoot;
+}
+
+$overwriteCondAddr = getenv('OVERWRITECONDADDR');
+if ($overwriteCondAddr) {
+ $CONFIG['overwritecondaddr'] = $overwriteCondAddr;
+}
+
+$trustedProxies = getenv('TRUSTED_PROXIES');
+if ($trustedProxies) {
+ $CONFIG['trusted_proxies'] = array_filter(array_map('trim', explode(' ', $trustedProxies)));
+}
diff --git a/19.0-beta/apache/config/reverse_proxy.config.php b/19.0-beta/apache/config/reverse_proxy.config.php
deleted file mode 100644
index 26a8bff3..00000000
--- a/19.0-beta/apache/config/reverse_proxy.config.php
+++ /dev/null
@@ -1,11 +0,0 @@
-<?php
-
-$trustedProxies = getenv('TRUSTED_PROXIES');
-
-if ($trustedProxies) {
- $trustedProxies = array_filter(array_map('trim', explode(' ', $trustedProxies)));
-} else {
- $trustedProxies = null;
-}
-
-$CONFIG['trusted_proxies'] = $trustedProxies; \ No newline at end of file
diff --git a/19.0-beta/fpm-alpine/config/reverse-proxy.config.php b/19.0-beta/fpm-alpine/config/reverse-proxy.config.php
new file mode 100644
index 00000000..667be312
--- /dev/null
+++ b/19.0-beta/fpm-alpine/config/reverse-proxy.config.php
@@ -0,0 +1,25 @@
+<?php
+$overwriteHost = getenv('OVERWRITEHOST');
+if ($overwriteHost) {
+ $CONFIG['overwritehost'] = $overwriteHost;
+}
+
+$overwriteProtocol = getenv('OVERWRITEPROTOCOL');
+if ($overwriteProtocol) {
+ $CONFIG['overwriteprotocol'] = $overwriteProtocol;
+}
+
+$overwriteWebRoot = getenv('OVERWRITEWEBROOT');
+if ($overwriteWebRoot) {
+ $CONFIG['overwritewebroot'] = $overwriteWebRoot;
+}
+
+$overwriteCondAddr = getenv('OVERWRITECONDADDR');
+if ($overwriteCondAddr) {
+ $CONFIG['overwritecondaddr'] = $overwriteCondAddr;
+}
+
+$trustedProxies = getenv('TRUSTED_PROXIES');
+if ($trustedProxies) {
+ $CONFIG['trusted_proxies'] = array_filter(array_map('trim', explode(' ', $trustedProxies)));
+}
diff --git a/19.0-beta/fpm-alpine/config/reverse_proxy.config.php b/19.0-beta/fpm-alpine/config/reverse_proxy.config.php
deleted file mode 100644
index 26a8bff3..00000000
--- a/19.0-beta/fpm-alpine/config/reverse_proxy.config.php
+++ /dev/null
@@ -1,11 +0,0 @@
-<?php
-
-$trustedProxies = getenv('TRUSTED_PROXIES');
-
-if ($trustedProxies) {
- $trustedProxies = array_filter(array_map('trim', explode(' ', $trustedProxies)));
-} else {
- $trustedProxies = null;
-}
-
-$CONFIG['trusted_proxies'] = $trustedProxies; \ No newline at end of file
diff --git a/19.0-beta/fpm/config/reverse-proxy.config.php b/19.0-beta/fpm/config/reverse-proxy.config.php
new file mode 100644
index 00000000..667be312
--- /dev/null
+++ b/19.0-beta/fpm/config/reverse-proxy.config.php
@@ -0,0 +1,25 @@
+<?php
+$overwriteHost = getenv('OVERWRITEHOST');
+if ($overwriteHost) {
+ $CONFIG['overwritehost'] = $overwriteHost;
+}
+
+$overwriteProtocol = getenv('OVERWRITEPROTOCOL');
+if ($overwriteProtocol) {
+ $CONFIG['overwriteprotocol'] = $overwriteProtocol;
+}
+
+$overwriteWebRoot = getenv('OVERWRITEWEBROOT');
+if ($overwriteWebRoot) {
+ $CONFIG['overwritewebroot'] = $overwriteWebRoot;
+}
+
+$overwriteCondAddr = getenv('OVERWRITECONDADDR');
+if ($overwriteCondAddr) {
+ $CONFIG['overwritecondaddr'] = $overwriteCondAddr;
+}
+
+$trustedProxies = getenv('TRUSTED_PROXIES');
+if ($trustedProxies) {
+ $CONFIG['trusted_proxies'] = array_filter(array_map('trim', explode(' ', $trustedProxies)));
+}
diff --git a/19.0-beta/fpm/config/reverse_proxy.config.php b/19.0-beta/fpm/config/reverse_proxy.config.php
deleted file mode 100644
index 26a8bff3..00000000
--- a/19.0-beta/fpm/config/reverse_proxy.config.php
+++ /dev/null
@@ -1,11 +0,0 @@
-<?php
-
-$trustedProxies = getenv('TRUSTED_PROXIES');
-
-if ($trustedProxies) {
- $trustedProxies = array_filter(array_map('trim', explode(' ', $trustedProxies)));
-} else {
- $trustedProxies = null;
-}
-
-$CONFIG['trusted_proxies'] = $trustedProxies; \ No newline at end of file
diff --git a/README.md b/README.md
index 4ea87e08..431072aa 100644
--- a/README.md
+++ b/README.md
@@ -156,7 +156,8 @@ To use an external SMTP server, you have to provide the connection details. To c
- `MAIL_FROM_ADDRESS` (not set by default): Use this address for the 'from' field in the emails sent by Nextcloud.
- `MAIL_DOMAIN` (not set by default): Set a different domain for the emails than the domain where Nextcloud is installed.
-Check the [Nextcloud documentation](https://docs.nextcloud.com/server/15/admin_manual/configuration_server/email_configuration.html) for other values to configure SMTP.
+Check the [Nextcloud documentation](https://docs.nextcloud.com/server/latest/admin_manual/configuration_server/email_configuration.html) for other values to configure SMTP.
+
## Using the apache image behind a reverse proxy and auto configure server host and protocol
@@ -166,6 +167,17 @@ The apache image will replace the remote addr (ip address visible to Nextcloud)
- `TRUSTED_PROXIES` (empty by default): A space-separated list of trusted proxies. CIDR notation is supported for IPv4.
+If the `TRUSTED_PROXIES` approach does not work for you, try using fixed values for overwrite parameters.
+
+- `OVERWRITEHOST` (empty by default): Set the hostname of the proxy. Can also specify a port.
+- `OVERWRITEPROTOCOL` (empty by default): Set the protocol of the proxy, http or https.
+- `OVERWRITEWEBROOT` (empty by default): Set the absolute path of the proxy.
+- `OVERWRITECONDADDR` (empty by default): Regex to overwrite the values dependent on the remote address.
+
+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.