Since Apache 2.4 I've started using mod_remoteip instead of mod_extract_forwarded for rewriting client address from x-forwarded-for provided by frontend servers (varnish, squid, apache etc).
So far everything works fine with the modules, i.e. php, cgi, wsgi etc... - client addresses are shown as they should be, but I couldn't write client address in access logs (%a, %h, %{c}a). No luck - I'm always getting 127.0.0.1 (localhost forward ex.).
How to log client's ip address when using mod_remoteip?
Update: IT WORKS O_O - see answer below
varnish configuration:
apache 2.4 configuration sections:
mod_remoteip:
logging (%a does the job):
+
if there is a nginx in front (ex. SSL termination):
According to mod_remoteip's documentation, the module should simply replace the client IP address, but only when
RemoteIPHeader x-forwarded-for
is set (doc). Also make sure, your vhost's logging makes use of the CustomLog you have defined.