nextcloud and Docker and reverse proxies
I have a nextcloud setup like described here (docker-compose, let’s encrypt proxy companion, postgres and nextcloud). And for a while I couldn’t connect any new nextcloud clients to the installation.
This fixed it:
<?php
$CONFIG = array (
# manually added because it's not picked up from
# the env vars once set ... it seems ...
# the docker IP range
'trusted_proxies' => ["172.16.0.0/12"],
# the hostname of the server
'overwritehost' => "my.super.secret.server",
# the ENDUSER->PROXY protocol, NOT the proxy-> nextcloud protocol!
'overwriteprotocol' => "https",
#
# AAAND NOW back to the original config file ...
# ...
)
Some notes:
- You have to add this directly to config.php, because once the container has started once the env vars have no effect
- Restarting the client helps as well.