Forum Discussion
sgoodliff_83611
Nimbostratus
Nov 22, 2007X-Forwarded-For
Hello,
I've been trying to extract the X-forwarded-For variable with a irule. But when I do something like this.
when HTTP_REQUEST {
set headers [HTTP::header names]
foreach header_name $headers {
log local0. "HTTP_header_DUMP [IP::client_addr] [IP::remote_addr] $header_name: [HTTP::header $header_name] ([string length [HTTP::header $header_name]]) "
}
}
The X-forwarded variable always returns the same as the client_addr and remote_addr which is the proxy server and not the real client.
The proxy sends the header in the request and its set to the correct ip.
Any ideas on how to access the variable or what part of my config must be stripping the variable ?
Thanks
Steve Goodliff
- hoolio
Cirrostratus
Hi Steve,when HTTP_REQUEST { log local0. "X-Forwarded-For: [HTTP::header values {X-Forwarded-For}]" }
- sgoodliff_83611
Nimbostratus
- hoolio
Cirrostratus
That's interesting... Can you post a snippet of the tcpdump which shows the format of the X-Forwarded-For header(s) to see if there is anything odd there? - sgoodliff_83611
Nimbostratus
Hello, - hoolio
Cirrostratus
Can you replace 'HTTP::header $header_name' with 'HTTP::header values $header_name' and retest?when HTTP_REQUEST { set headers [HTTP::header names] log local0. "\$headers: $headers" foreach header_name $headers { log local0. "HTTP_header_DUMP [IP::client_addr] [IP::remote_addr] $header_name: [HTTP::header values $header_name] ([string length [HTTP::header $header_name]]) " } }
Recent Discussions
Related Content
DevCentral Quicklinks
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com
Discover DevCentral Connects