We're using the amazon elastic load balancer, and were trying to get
the logs to reflect the original user IP address, rather than the
internal address of the load balancer. I can't seem to access the X-
Forwarded-For header.

I created a new LogFormat that looks like this:

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

I replaced the %h with the X-Forwarded-For header, which is also
commented in the apache config file.

# If you are behind a reverse proxy, you might want to change %h into %
{X-Forwarded-For}i

That results in the log look like this:

- - - [30/Jul/2010:19:59:23 +0000] "GET /favicon.ico HTTP/1.1" 404 512
"http://www.ucdev-colorado.scalr.ws/"; "Mozilla/5.0 (Macintosh; U;
Intel Mac OS X 10_6_4; en-us) AppleWebKit/533.16 (KHTML, like Gecko)
Version/5.0 Safari/533.16"

We get the "- - -" when we put in other headers that I know don't
exist. Is there a way, besides this LogFormat, for me to check that
this header is being set. I checked out the relevant variables in PHP
in a script, and I don't see the X-Forwarded-For header being set. Is
the setting of this header an option with the ELB?

The web server is the stock apache2 (2.2.14) running on Ubuntu Lucid
(10.04 LTS) from the scalr image.

any help would be greatly appreciated.

Thanks,
Bryan

-- 
You received this message because you are subscribed to the Google Groups 
"scalr-discuss" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/scalr-discuss?hl=en.

Reply via email to