I run Nextcloud in a docker container (:latest
, currently 18.0.4). I access it via a reverse proxy.
When looking at the logs, I see one single IP address as the source (the docker network gateway). It seems that the logs display the IP address of the proxy and not the one from the header X-Forwarded-For
, which is the real one (and the only one interesting).
Per the documentation, I updated my configuration file with
'trusted_proxies' => array('172.18.0.0/16'),
'forwarded_for_headers' => array('HTTP_X_FORWARDED_FOR'),
but there are no changes (trusted_proxies
is the whole range of the docker network because the proxy (itself a container - but with directly exposed ports) can be anywhere)
Just to be complete with the question, the proxy server specifically sets the X-Forwarded-For
header:
By default, Caddy passes thru incoming headers to the backendâincluding the
Host
headerâwithout modifications, with two exceptions:
- It adds or augments the X-Forwarded-For header field.
- It sets the X-Forwarded-Proto header field.