Forum Discussion
Andy_O_4935
Nov 01, 2011Nimbostratus
X-Forwarded-for Header Insertion
In a lab setup, I wrote an irule to insert an X-forwarder-for header if one doesn't exist and using snat automap.
The Ip address I see on the webserver is the SNAT (floating) IP address which i...
nitass
Nov 02, 2011Employee
this is mine.
[root@iris:Active] config b virtual bar list
virtual bar {
snat automap
pool foo
destination 172.28.17.33:http
ip protocol tcp
rules myrule
profiles {
http {}
tcp {}
}
}
[root@iris:Active] config b pool foo list
pool foo {
members 10.10.70.110:http {}
}
[root@iris:Active] config b rule myrule list
rule myrule {
when HTTP_REQUEST {
if {not [HTTP::header exists "X-Forwarded-For"]} {
HTTP::header insert X-Forwarded-For [IP::client_addr]
}
}
}
[root@iris:Active] config ssldump -Aed -nni 0.0 port 80
New TCP connection 1: 172.28.17.20(54179) <-> 172.28.17.33(80)
1320232511.5958 (0.0011) C>S
---------------------------------------------------------------
HEAD / HTTP/1.1
User-Agent: curl/7.15.5 (i686-redhat-linux-gnu) libcurl/7.15.5 OpenSSL/0.9.8b zlib/1.2.3 libidn/0.6.5
Host: 172.28.17.33
Accept: */*
---------------------------------------------------------------
New TCP connection 2: 10.10.72.30(54179) <-> 10.10.70.110(80)
1320232511.5962 (0.0003) C>S
---------------------------------------------------------------
HEAD / HTTP/1.1
User-Agent: curl/7.15.5 (i686-redhat-linux-gnu) libcurl/7.15.5 OpenSSL/0.9.8b zlib/1.2.3 libidn/0.6.5
Host: 172.28.17.33
Accept: */*
X-Forwarded-For: 172.28.17.20
- Arun_02_139047Dec 24, 2013NimbostratusHi Guys - I have a requirement to use Insert X-Forwarded-For for a TCP Profile. Can you guys advise how I can do that? I have RabbitMQ Queues behind F5 on TCP port 5672. Thanks! -arun.
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