Forum Discussion

PSFletchTheTek's avatar
Jul 13, 2022

irule - Proxy Protocol - always good to learn something new!

Hi All,

So i've implemented this irule

It's working brillantly and i'm learning a lot about it already.

But i need some advice, what i need it to do is add a HTTP Header of X-Forworded-For of the $v2sourceAddress so i can pass that through to ASM.
But i'm getting a error of "command is not valid in current event context", now my gut feeling is that this is because the irule is working at the client conenction / tcp level and not the HTTP profile level to understand that the flow is HTTP and that a header can be added.

Can anyone suggest how i can add to this iRule to add this functionality please? 
I'm stuggling to find any relevant information on if my gut feeling is correct let alone how to solve it.

Thanks all - Fletch

1 Reply

  • The X-Forwarded-For header will be inserted in the iRule event context HTTP_REQUEST.

    You can as well set a checkbox in the http profile. Please make sure to setup a custom http profile and leave the default profile untouched. (Modifying a default profile may result in not being synched or not rolled forward with an update.)