Apache LogFormat and X-Forwarded-For header

Post your questions about Web Server usage and Apache + PHP + MySQL/SQLite web applications.
Post Reply
fdm91
First post
Posts: 1
Joined: Wed May 31, 2023 7:27 am

Apache LogFormat and X-Forwarded-For header

Post by fdm91 »

Hi all!
I have a VM that runs a proxy server that redirects requests to my.domain.com to a Qnap Nas. For this reasons, my Qnap logs every request sent through my.domain.com as it was requested from proxy IP, so I'm not able to use integrated firewall or ban settings because the only IP seen by Qnap is the proxy's IP. I would like Qnap to log accesses using real ip instead of proxy IP using X-Forwarded-For header and apache' remoteip mod.

I tried to edit the apache.conf in /etc/config, loading the mod and change the combined LogFormat to %a instead of %h so it could read the real IP header instead of the proxy's one, tried everything but it still seems to log my proxy IP on every access request. I was able to edit similarly the Proxmox VE and the MailServer (NethServer based) configurations to do exactly the same thing, and it worked successfully.

I really don't know where I'm wrong, can someone help me understanding what I'm doing wrong?

Thank you very much in advance
Post Reply

Return to “Web Server & Applications (Apache + PHP + MySQL / SQLite)”