0

I have a load balancing IP in front of 2 apache servers

On the backend servers I'm using Apache 2.4 with mod_remoteip enabled to retrieve the real client IP which is working so long as the request is sent over HTTP, if a request is sent over HTTPS the 'X-Forward-For' is omitted

Is there a way to easily retrieve this?

First thought is to get all requests over HTTP and then forward to HTTPS with the hope of preserving that header

LogFormat being used - LogFormat "%{X-Forwarded-For}i %h %l %u %t \"%r\" %>s %O \"%{Referer}i\" \"%{User-Agent}i\"" combined

2
  • please, can you tell us, what kind of loadbalancer?
    – c4f4t0r
    Oct 10, 2017 at 14:51
  • It's a loadbalance IP purchased from OVH (ovh.co.uk/solutions/ip-load-balancing) so I don't really have control over the setup of the actual loadbalancer. Oct 12, 2017 at 8:34

1 Answer 1

0

X-Forwarded-For is a request header so it's upt to the client connecting to add that header or not to the request.

Apache itself can add that header in a request if it acts a proxy.

So, if the header is not there, the original request does not include the header.

2
  • I don't have control over the actual loadbalancer unfortunately. Would it be possible to direct everyone to port 80 and then redirect them to 443 including this X-Forwarded-For header? Oct 12, 2017 at 8:48
  • I don't think so. Oct 13, 2017 at 12:21

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .