-
Notifications
You must be signed in to change notification settings - Fork 78
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
IP address is incorrect in Apache access logs #27
Comments
Hello Cyril, Did you try to replace the LogFormat "%h" value with "%a" ? |
Hi @nfillot, I replaced I think it's better if mod_rpaf works with the default Is there a way to avoid this regression? Thanks. |
That would be nice indeed. |
Can you please verify the headers being passed from the reverse proxy? Your configuration for mod_rpaf doesnt explicity set it via |
My config: RPAF_Enable On pcap'ed traffic on backend, traffic from X.X.X.X(proxy server): X-Forwarded-For: Y.Y.Y.Y (my computer) This is apache2.4 from debian jessie: https://packages.debian.org/jessie/apache2 The funny thing is that i tried the latest version from here because i had the exact opposite result with the rpaf 0.6 version in Jessie, incorrect IP (proxy server ip) in php, and correct IP in logs (probably related to the ticket you got a few weeks ago:) Rpaf from jessie is here: |
Is that %a or %h in the log config? (Both from memory, hope it makes sense) |
It's %h in apache2.conf, at least in debian Jessie. And using %a shows the correct IP (client IP Y.Y.Y.Y). |
We have the same problen (in 0.8.4). %a is working, but %h is the proxy ip. |
I seriously think now it is perfect like this, before there was no way to keep both the Proxy IP and the Client IP. Though the change was surprising, maybe it could be more documented. Thank you! |
i think this is regression, can there be added perhaps separate option to control this? as changing log format in all vhosts and installations can be problematic, can surely still miss some place. |
for reference adding doc what
http://httpd.apache.org/docs/current/mod/mod_log_config.html#formats |
ps: i tested that with php if there's no plan to fix the |
tested mod_remoteip and seems behave identical to
|
@gnif ping. please see discussion and my notes. what's your verdict? |
This is not a viable fix for this, there is an issue with mod_rpaf as it is intended to make the reverse proxy transparent, there should be no need to reconfigure any logging. I will investigate this when I find some time. |
Also keep in mind that the Apache API changed in 2.4 to separate the client and connection/peer address. If historically Behaving similar to |
After an upgrade from 0.6 to 0.8.4, the IP address is no longer correctly defined in the Apache access logs but is still correct in ErrorLog file and the
server-status
page: the IP address of the proxy is shown in the access logs, instead.I'm running Debian/jessie with Apache 2.4.10-10 and can reproduce the issue on two distinct machines, both running the same environment.
mod_rpaf configuration:
Apache logs configuration:
Logs extract (10.10.0.254 is the client IP address and 127.0.0.1 is the proxy):
server-status
page:The text was updated successfully, but these errors were encountered: