Forum Discussion

mhighton_240135's avatar
mhighton_240135
Icon for Nimbostratus rankNimbostratus
Apr 20, 2017

HTTP Forwarded Header iRule

RFC 7239 HTTP extension, Forwarded Header

 

We are looking to replace the X-Forwarded-For header for the newer Forwarded header equivalent. I can see this is not supported natively by F5 but can anyone advise if we can acheive the same thing via an iRule that can be applied to the traffic flow?

 

3 Replies

  • Hi,

     

    You can use below irule to replace X-Forwarded-For header

     

    when HTTP_REQUEST { HTTP::header remove "X-Forwarded-For" HTTP::header replace "X-Forwarded-For" [IP::client_addr] }

     

    • mhighton_240135's avatar
      mhighton_240135
      Icon for Nimbostratus rankNimbostratus

      Thanks for the response.

       

      Though I think are application guys are more interested in the additional features in the Forwarded Header rather than just seeing the client IP. Think otherwise would just stick with X Forwarded For

       

  • Hi,

    you can use this irule:

    when HTTP_REQUEST { 
        HTTP::header insert "Forwarded" [IP::client_addr] 
    }