mirror of
https://github.com/nextcloud/docker.git
synced 2025-03-14 18:35:08 +01:00
Expose reverse proxy related configuration as environment variables
Signed-off-by: András Maróy <andras@maroy.hu>
This commit is contained in:
parent
cf3476d71b
commit
639d16207a
11 changed files with 210 additions and 0 deletions
20
.config/reverse-proxy.config.php
Normal file
20
.config/reverse-proxy.config.php
Normal file
|
@ -0,0 +1,20 @@
|
|||
<?php
|
||||
if (getenv('OVERWRITEHOST')) {
|
||||
$CONFIG['overwritehost'] = getenv('OVERWRITEHOST');
|
||||
}
|
||||
|
||||
if (getenv('OVERWRITEPROTOCOL')) {
|
||||
$CONFIG['overwriteprotocol'] = getenv('OVERWRITEPROTOCOL');
|
||||
}
|
||||
|
||||
if (getenv('OVERWRITEWEBROOT')) {
|
||||
$CONFIG['overwritewebroot'] = getenv('OVERWRITEWEBROOT');
|
||||
}
|
||||
|
||||
if (getenv('OVERWRITECONDADDR')) {
|
||||
$CONFIG['overwritecondaddr'] = getenv('OVERWRITECONDADDR');
|
||||
}
|
||||
|
||||
if (getenv('TRUSTED_PROXIES')) {
|
||||
$CONFIG['trusted_proxies'] = explode(',', getenv('TRUSTED_PROXIES'));
|
||||
}
|
20
16.0/apache/config/reverse-proxy.config.php
Normal file
20
16.0/apache/config/reverse-proxy.config.php
Normal file
|
@ -0,0 +1,20 @@
|
|||
<?php
|
||||
if (getenv('OVERWRITEHOST')) {
|
||||
$CONFIG['overwritehost'] = getenv('OVERWRITEHOST');
|
||||
}
|
||||
|
||||
if (getenv('OVERWRITEPROTOCOL')) {
|
||||
$CONFIG['overwriteprotocol'] = getenv('OVERWRITEPROTOCOL');
|
||||
}
|
||||
|
||||
if (getenv('OVERWRITEWEBROOT')) {
|
||||
$CONFIG['overwritewebroot'] = getenv('OVERWRITEWEBROOT');
|
||||
}
|
||||
|
||||
if (getenv('OVERWRITECONDADDR')) {
|
||||
$CONFIG['overwritecondaddr'] = getenv('OVERWRITECONDADDR');
|
||||
}
|
||||
|
||||
if (getenv('TRUSTED_PROXIES')) {
|
||||
$CONFIG['trusted_proxies'] = explode(',', getenv('TRUSTED_PROXIES'));
|
||||
}
|
20
16.0/fpm-alpine/config/reverse-proxy.config.php
Normal file
20
16.0/fpm-alpine/config/reverse-proxy.config.php
Normal file
|
@ -0,0 +1,20 @@
|
|||
<?php
|
||||
if (getenv('OVERWRITEHOST')) {
|
||||
$CONFIG['overwritehost'] = getenv('OVERWRITEHOST');
|
||||
}
|
||||
|
||||
if (getenv('OVERWRITEPROTOCOL')) {
|
||||
$CONFIG['overwriteprotocol'] = getenv('OVERWRITEPROTOCOL');
|
||||
}
|
||||
|
||||
if (getenv('OVERWRITEWEBROOT')) {
|
||||
$CONFIG['overwritewebroot'] = getenv('OVERWRITEWEBROOT');
|
||||
}
|
||||
|
||||
if (getenv('OVERWRITECONDADDR')) {
|
||||
$CONFIG['overwritecondaddr'] = getenv('OVERWRITECONDADDR');
|
||||
}
|
||||
|
||||
if (getenv('TRUSTED_PROXIES')) {
|
||||
$CONFIG['trusted_proxies'] = explode(',', getenv('TRUSTED_PROXIES'));
|
||||
}
|
20
16.0/fpm/config/reverse-proxy.config.php
Normal file
20
16.0/fpm/config/reverse-proxy.config.php
Normal file
|
@ -0,0 +1,20 @@
|
|||
<?php
|
||||
if (getenv('OVERWRITEHOST')) {
|
||||
$CONFIG['overwritehost'] = getenv('OVERWRITEHOST');
|
||||
}
|
||||
|
||||
if (getenv('OVERWRITEPROTOCOL')) {
|
||||
$CONFIG['overwriteprotocol'] = getenv('OVERWRITEPROTOCOL');
|
||||
}
|
||||
|
||||
if (getenv('OVERWRITEWEBROOT')) {
|
||||
$CONFIG['overwritewebroot'] = getenv('OVERWRITEWEBROOT');
|
||||
}
|
||||
|
||||
if (getenv('OVERWRITECONDADDR')) {
|
||||
$CONFIG['overwritecondaddr'] = getenv('OVERWRITECONDADDR');
|
||||
}
|
||||
|
||||
if (getenv('TRUSTED_PROXIES')) {
|
||||
$CONFIG['trusted_proxies'] = explode(',', getenv('TRUSTED_PROXIES'));
|
||||
}
|
20
17.0/apache/config/reverse-proxy.config.php
Normal file
20
17.0/apache/config/reverse-proxy.config.php
Normal file
|
@ -0,0 +1,20 @@
|
|||
<?php
|
||||
if (getenv('OVERWRITEHOST')) {
|
||||
$CONFIG['overwritehost'] = getenv('OVERWRITEHOST');
|
||||
}
|
||||
|
||||
if (getenv('OVERWRITEPROTOCOL')) {
|
||||
$CONFIG['overwriteprotocol'] = getenv('OVERWRITEPROTOCOL');
|
||||
}
|
||||
|
||||
if (getenv('OVERWRITEWEBROOT')) {
|
||||
$CONFIG['overwritewebroot'] = getenv('OVERWRITEWEBROOT');
|
||||
}
|
||||
|
||||
if (getenv('OVERWRITECONDADDR')) {
|
||||
$CONFIG['overwritecondaddr'] = getenv('OVERWRITECONDADDR');
|
||||
}
|
||||
|
||||
if (getenv('TRUSTED_PROXIES')) {
|
||||
$CONFIG['trusted_proxies'] = explode(',', getenv('TRUSTED_PROXIES'));
|
||||
}
|
20
17.0/fpm-alpine/config/reverse-proxy.config.php
Normal file
20
17.0/fpm-alpine/config/reverse-proxy.config.php
Normal file
|
@ -0,0 +1,20 @@
|
|||
<?php
|
||||
if (getenv('OVERWRITEHOST')) {
|
||||
$CONFIG['overwritehost'] = getenv('OVERWRITEHOST');
|
||||
}
|
||||
|
||||
if (getenv('OVERWRITEPROTOCOL')) {
|
||||
$CONFIG['overwriteprotocol'] = getenv('OVERWRITEPROTOCOL');
|
||||
}
|
||||
|
||||
if (getenv('OVERWRITEWEBROOT')) {
|
||||
$CONFIG['overwritewebroot'] = getenv('OVERWRITEWEBROOT');
|
||||
}
|
||||
|
||||
if (getenv('OVERWRITECONDADDR')) {
|
||||
$CONFIG['overwritecondaddr'] = getenv('OVERWRITECONDADDR');
|
||||
}
|
||||
|
||||
if (getenv('TRUSTED_PROXIES')) {
|
||||
$CONFIG['trusted_proxies'] = explode(',', getenv('TRUSTED_PROXIES'));
|
||||
}
|
20
17.0/fpm/config/reverse-proxy.config.php
Normal file
20
17.0/fpm/config/reverse-proxy.config.php
Normal file
|
@ -0,0 +1,20 @@
|
|||
<?php
|
||||
if (getenv('OVERWRITEHOST')) {
|
||||
$CONFIG['overwritehost'] = getenv('OVERWRITEHOST');
|
||||
}
|
||||
|
||||
if (getenv('OVERWRITEPROTOCOL')) {
|
||||
$CONFIG['overwriteprotocol'] = getenv('OVERWRITEPROTOCOL');
|
||||
}
|
||||
|
||||
if (getenv('OVERWRITEWEBROOT')) {
|
||||
$CONFIG['overwritewebroot'] = getenv('OVERWRITEWEBROOT');
|
||||
}
|
||||
|
||||
if (getenv('OVERWRITECONDADDR')) {
|
||||
$CONFIG['overwritecondaddr'] = getenv('OVERWRITECONDADDR');
|
||||
}
|
||||
|
||||
if (getenv('TRUSTED_PROXIES')) {
|
||||
$CONFIG['trusted_proxies'] = explode(',', getenv('TRUSTED_PROXIES'));
|
||||
}
|
20
18.0/apache/config/reverse-proxy.config.php
Normal file
20
18.0/apache/config/reverse-proxy.config.php
Normal file
|
@ -0,0 +1,20 @@
|
|||
<?php
|
||||
if (getenv('OVERWRITEHOST')) {
|
||||
$CONFIG['overwritehost'] = getenv('OVERWRITEHOST');
|
||||
}
|
||||
|
||||
if (getenv('OVERWRITEPROTOCOL')) {
|
||||
$CONFIG['overwriteprotocol'] = getenv('OVERWRITEPROTOCOL');
|
||||
}
|
||||
|
||||
if (getenv('OVERWRITEWEBROOT')) {
|
||||
$CONFIG['overwritewebroot'] = getenv('OVERWRITEWEBROOT');
|
||||
}
|
||||
|
||||
if (getenv('OVERWRITECONDADDR')) {
|
||||
$CONFIG['overwritecondaddr'] = getenv('OVERWRITECONDADDR');
|
||||
}
|
||||
|
||||
if (getenv('TRUSTED_PROXIES')) {
|
||||
$CONFIG['trusted_proxies'] = explode(',', getenv('TRUSTED_PROXIES'));
|
||||
}
|
20
18.0/fpm-alpine/config/reverse-proxy.config.php
Normal file
20
18.0/fpm-alpine/config/reverse-proxy.config.php
Normal file
|
@ -0,0 +1,20 @@
|
|||
<?php
|
||||
if (getenv('OVERWRITEHOST')) {
|
||||
$CONFIG['overwritehost'] = getenv('OVERWRITEHOST');
|
||||
}
|
||||
|
||||
if (getenv('OVERWRITEPROTOCOL')) {
|
||||
$CONFIG['overwriteprotocol'] = getenv('OVERWRITEPROTOCOL');
|
||||
}
|
||||
|
||||
if (getenv('OVERWRITEWEBROOT')) {
|
||||
$CONFIG['overwritewebroot'] = getenv('OVERWRITEWEBROOT');
|
||||
}
|
||||
|
||||
if (getenv('OVERWRITECONDADDR')) {
|
||||
$CONFIG['overwritecondaddr'] = getenv('OVERWRITECONDADDR');
|
||||
}
|
||||
|
||||
if (getenv('TRUSTED_PROXIES')) {
|
||||
$CONFIG['trusted_proxies'] = explode(',', getenv('TRUSTED_PROXIES'));
|
||||
}
|
20
18.0/fpm/config/reverse-proxy.config.php
Normal file
20
18.0/fpm/config/reverse-proxy.config.php
Normal file
|
@ -0,0 +1,20 @@
|
|||
<?php
|
||||
if (getenv('OVERWRITEHOST')) {
|
||||
$CONFIG['overwritehost'] = getenv('OVERWRITEHOST');
|
||||
}
|
||||
|
||||
if (getenv('OVERWRITEPROTOCOL')) {
|
||||
$CONFIG['overwriteprotocol'] = getenv('OVERWRITEPROTOCOL');
|
||||
}
|
||||
|
||||
if (getenv('OVERWRITEWEBROOT')) {
|
||||
$CONFIG['overwritewebroot'] = getenv('OVERWRITEWEBROOT');
|
||||
}
|
||||
|
||||
if (getenv('OVERWRITECONDADDR')) {
|
||||
$CONFIG['overwritecondaddr'] = getenv('OVERWRITECONDADDR');
|
||||
}
|
||||
|
||||
if (getenv('TRUSTED_PROXIES')) {
|
||||
$CONFIG['trusted_proxies'] = explode(',', getenv('TRUSTED_PROXIES'));
|
||||
}
|
10
README.md
10
README.md
|
@ -158,6 +158,16 @@ To use an external SMTP server, you have to provide the connection details. To c
|
|||
|
||||
Check the [Nextcloud documentation](https://docs.nextcloud.com/server/15/admin_manual/configuration_server/email_configuration.html) for other values to configure SMTP.
|
||||
|
||||
To use Nextcloud behind a reverse proxy you can use the following environment variables:
|
||||
|
||||
- `OVERWRITEHOST` (not set by default): Set the hostname of the proxy. Can also specify a port.
|
||||
- `OVERWRITEPROTOCOL` (not set by default): Set the protocol of the proxy, http or https.
|
||||
- `OVERWRITEWEBROOT` (not set by default): Set the absolute path of the proxy.
|
||||
- `OVERWRITECONDADDR` (not set by default): Regex to overwrite the values dependent on the remote address.
|
||||
- `TRUSTED_PROXIES` (not set by default): A comma separated list of IPv4 addresses, IPv4 ranges in CIDR notation or IPv6 addresses of proxies Nextcloud should trust.
|
||||
|
||||
Check the [Nexcloud documentation](https://docs.nextcloud.com/server/18/admin_manual/configuration_server/reverse_proxy_configuration.html) for more details.
|
||||
|
||||
# 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.
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue