httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From <>
Subject [users@httpd] RequesHeader directive not adding directive
Date Mon, 09 Feb 2009 17:24:18 GMT
We have a forum site that is behind a load balancer and the site relies
on ip addresses to detect failed logins. This does not work because the
loadbalancer changes the source ip address to that of itself.

our load balancer(f5) adds the original ip as x-forwarded-for http

However the third party software that we use don't pick up this header. 

Here is the relevant line(I think anyway, the function is called
fetch_alt_ip) from the software:
else if (isset($_SERVER['HTTP_X_FORWARDED_FOR']) AND

If I have to change the code the following works by editing the fetch_ip
function from:
return (getenv(HTTP_X_FORWARDED_FOR))
: getenv(REMOTE_ADDR);

I have changed the HTTP_X_FORWARDED_FOR to x-forwarded-for in lower and
upper case but the software still did not pick it up.

However I am not keen on changing the source code as that complicates
matters when you upgrade and someone might forget to change the source
code again or not read the documentation

After a bit of googling I thought I would give RequestHeader a go and
wrote the following:

RequestHeader append HTTP_X_FORWARDED_FOR "%{x-forwarded-for}e"

However the forum software does not pick this up and nor do I see the
value in my log file:
LogFormat "xforwarded:%{x-forwarded-for}i
rlnclient:%{rlnclientipaddr}i   forumsoftware:%{HTTP_X_FORWARDED_FOR}i
vanilla: %h" gg2

This is a typical log entry:
xforwarded:   rlnclient:
forumsoftware:(null)   vanilla:

Am I using request header wrong or doing something else stupid?


This email has been scanned by the MessageLabs Email Security System.
For more information please visit 

The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:> for more info.
To unsubscribe, e-mail:
   "   from the digest:
For additional commands, e-mail:

View raw message