Replace RemoteIPTrustedProxy by RemoteIPInternalProxy in remoteip.conf #2004
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Else the internal IP ranges are ignored
See https://httpd.apache.org/docs/2.4/en/mod/mod_remoteip.html#remoteiptrustedproxy and https://httpd.apache.org/docs/2.4/en/mod/mod_remoteip.html#remoteipinternalproxy
It's a problem at least when you have several chained local reverse-proxies. In my case: a frontal reverse-proxy, followed by Traefik (Ingress implementation of k3s) before reaching this docker image.
Symptom: the docker image logs (on stdout) the IP of a reverse-proxy instead of the actual client IP.
Should fix #1103
See also https://help.nextcloud.com/t/apache-docker-behind-reverse-proxy/151754 and nextcloud/helm#164 that mention the same problem, and same fix.
NB: I've submitted a similar PR for wordpress: docker-library/wordpress#830
NB2: in my case, I still have to override remoteip.conf with
RemoteIPHeader X-Forwarded-For
instead ofRemoteIPHeader X-Real-IP
, becauseX-Forwarded-For
is the HTTP header my reverse-proxies are using. Even ifX-Forwarded-For
seems a more common use-case to me (it's the one used by wordpress, too), I did not dare to change it in this PR (to not break any backward compatibility). But I can surely do if you ask