Forum Discussion

Michael_Van_Imp's avatar
Michael_Van_Imp
Icon for Nimbostratus rankNimbostratus
Dec 01, 2014

Irule insert X-forward-host value

Hi everyone,

 

I would like to add a x-forward-host but I don't know the exact syntax to add it. The goal is that I redirect traffic to another webserver and that he knows where the client tried to connect, to avoid mixing UAT and prod traffic:

 

this is for the redirect (works fine): when HTTP_REQUEST { if { [ HTTP::header value Host ] equals "Uat.example.com" }{ HTTP::header replace Host "uat.destination.com" pool UAT } }

 

This is what I have till now for the x-forward-host (I copied it from the x-forward-for)

 

when HTTP_REQUEST { HTTP::header insert X-Forwarded-host [???] }

 

Someone any idea ?

 

thanks

 

6 Replies

  • Will this work?

    when HTTP_REQUEST {
        HTTP::header insert X-Forwarded-host [HTTP::host]
    }
    
    • Hari_Kishore_D_'s avatar
      Hari_Kishore_D_
      Icon for Nimbostratus rankNimbostratus
      Did this work for you Michael. Am also looking for inserting x-forwarded-host and x-forwarded-proto into HTTP header. Hari
    • Hari_Kishore_D_'s avatar
      Hari_Kishore_D_
      Icon for Nimbostratus rankNimbostratus
      Did this work for you Michael. Am also looking for inserting x-forwarded-host and x-forwarded-proto into HTTP header. Hari