Forum Discussion

Jericho_Gutierr's avatar
Jericho_Gutierr
Icon for Nimbostratus rankNimbostratus
Aug 17, 2006

'XForwarded for' adds second IP

I have the following scenario:

 

 

- External clients are load balanced to a pool of Apache proxies (Apache running mod_proxy). I've enabled 'XForwarded for' to preserve the client's IP address for log purposes.

 

- The Apache proxies send client traffic to a pool of Apache webservers. This pool does NOT have XForwarded enabled.

 

- The Apache proxies and webservers are hanging off the BigIP in a one-armed configuration, i.e. they are on the same VLAN.

 

 

The problem I'm seeing is that the requests to the webservers are showing two IPs in the 'XForwarded for' portion of the header: the original client IP, and the IP of the BigIP. Why is the BigIP self-ip included? How do I get rid of it?

 

 

- Jericho

3 Replies

  • unRuleY_95363's avatar
    unRuleY_95363
    Historic F5 Account
    You could certainly add a rule that removes the existing X-Forwarded-For header (or renames it to X-X-Forwarded-For).

     

  • i am also getting both client ip & the ip of F5 in Apache logs ...with the below script:

     

     

    LogFormat "%v %{X-Forwarded-For}i %h %l %u %t \"%r\" %>s %b" X-Forwarded-For

     

    CustomLog /var/log/httpd/www1.bhaskar.com-xforwarded.log X-Forwarded-For

     

     

    can anybody plz suggest?

     

     

    M@ny Thanks..!

     

    -Mayur
  • %h in your LogFormat statement will be the 'real' IP of the F5, remove that and all will be well.