Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace RemoteIPTrustedProxy by RemoteIPInternalProxy in remoteip.conf #2004

Conversation

mossroy
Copy link
Contributor

@mossroy mossroy commented Jun 6, 2023

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 of RemoteIPHeader X-Real-IP, because X-Forwarded-For is the HTTP header my reverse-proxies are using. Even if X-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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

apache image logging client ip address behind reverse proxy
2 participants