Forum Discussion
Matt_Elkington
Nimbostratus
Sep 03, 2007Using REMOTE_ADDR
This is my first iRule :-), and the first service I have depoloyed behind a LTM.
We have a web application that uses the REMOTE_ADDR header to preform tracking, originally it was not behind a load balancer, so REMOTE_ADDR reported the actual client IP of the originating http request.
Now the web server (well web servers now :-) ) are behind a LTM, the REMOTE_ADDR header is reported as the internal floating IP of the LTM pair.
Now if I apply the following iRule to the service, will it report the correct REMOTE_ADDR, and will it still work?
when HTTP_REQUEST {
HTTP::header insert REMOTE_ADDR [IP::remote_addr]
}
Or would it be better to insert my own header and get the app guys to rewrite their application to use a custom header instead?
Such as
when HTTP_REQUEST {
HTTP::header insert REAL_CLIENT_IP [IP::remote_addr]
}
Many thanks in advance.
- The only comment I have is that you may not receive the results you are expecting if the REMOTE_ADDR header already exists in the request.
- Jose_Santiago_O
Nimbostratus
You can preserve the original client Ip using the x-forwarded-for header... - kckirwan_49724
Nimbostratus
We had the same problem using weblogic (logging was using the float IP from the F5 Load Balancers). Here's what I used to foward the client IP. - Matt_Elkington
Nimbostratus
Thanks for all your responses.
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