F5 BIG-IP LTM Specialist: Maintain and Troubleshoot — Question 70
A web application requires knowledge of the client's true IP address for logging and analysis purposes. Instances of the application that can decode X-
Forwarded-For HTTP headers reside in pool_a, while pool_b instances assume the source IP is the true address of the client.
Which iRule provides the proper functionality?
Answer options
- A. when HTTP_DATA { if {[HTTP::header exists X-Forwarded-For]}{ pool pool_a } else { pool pool_b } }
- B. when HTTP_RESPONSE { if {[HTTP::header exists X-Forwarded-For]}{ pool pool_a } else { pool pool_b } }
- C. when HTTP_REQUEST { if {[HTTP::header exists X-Forwarded-For]}{ pool pool_a } else { pool pool_b } }
- D. when HTTP_OPEN { if {[HTTP::header exists X-Forwarded-For]}{ pool pool_a } else { pool pool_b }
Correct answer: C
Explanation
The correct answer is C because the HTTP_REQUEST event occurs when a request is received from the client, allowing the application to check for the X-Forwarded-For header at the appropriate time. Options A and B are incorrect as they trigger at different phases of the HTTP transaction and would not handle the IP address determination correctly. Option D is also incorrect as it does not relate to the HTTP request lifecycle where the header would be checked.