Does mod_status keep X-FORWARDED-FOR header?

by user893730   Last Updated August 14, 2019 15:01 PM

I have a server behind loadbalencer (Amazon ELB), which hides people's IP address when connections come to web servers.

However it sends the IP address of the visitor in X-FORWARDED-FOR header.

I was wondering if I would be able to use some kind of tool along with Apache's mod_status to retrieve a list of currently active connections and their originating IP addresses.



Answers 1


So this comes late but sharing here for reference.

Apparently mod_status picks up the IP from apache logs. So you need to have the mod_remoteip enabled and setup right.

<IfModule remoteip_module>
        RemoteIPHeader X-Forwarded-For
        RemoteIPProxiesHeader X-Forwarded-By
</IfModule>

And finally start using this info in the logs:

CustomLog ${APACHE_LOG_DIR}/other_vhosts_access.log "%v:%p %a %h %l %u %t \"%r\" %>s %O \"%{Referer}i\" \"%{User-Agent}i\""

The %a variable is the Client IP address of the request and %h is the remote hostname. Will log the IP address if HostnameLookups is set to Off, which is the default.

Shivanand Sharma
Shivanand Sharma
August 14, 2019 14:53 PM

Related Questions


Spring Boot, Route 53, EC2, Apache

Updated March 26, 2019 16:01 PM

AWS Load Balancer Gateway Time-out 504

Updated August 19, 2019 10:01 AM

Post rewrite 404 errors

Updated July 21, 2017 14:01 PM

Setup Apache HTTPS in Amazon WS with ACM

Updated April 27, 2017 08:01 AM

can't ssh and open aws ubuntu server

Updated July 19, 2017 10:01 AM