Copy X-Forwarded-For into custom header

spirrellospirrello Member
Hi,

Does anyone know if there is a way to copy the source ip from "X-Forwarded-For" into a customer header? We're trying to preserve the true source IP from users after traffic is sent to our A10 from a proxy firewall and our application uses a custom header for specific functionality. I'd imagine this is plausible with aflex we just don't know how to write it up.
Tagged:

Comments

  • diederikdiederik Member
    edited June 2014
    Hello,

    I think this should do the trick:

    Replace Other-Custom-Header with the header name you need.
    when HTTP_REQUEST {
     if { [ HTTP::header exists "X-Forwarded-For"] }  {
       HTTP::header insert "Other-Custom-Header" [HTTP::header X-Forwarded-For]
     }
    }
    
  • spirrellospirrello Member
    edited June 2014
    That worked, thank you so much!
  • diederikdiederik Member
    edited June 2014
    Good to hear!

    My pleasure :)
Sign In or Register to comment.