Learn F5 Technologies, Get Answers & Share Community Solutions Join DevCentral

Filter by:
  • Solution
  • Technology
Clear all filters
Answers

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

0
Rate this Question

Answers to this Question

placeholder+image
USER ACCEPTED ANSWER & F5 ACCEPTED ANSWER

Will this work?

when HTTP_REQUEST {
    HTTP::header insert X-Forwarded-host [HTTP::host]
}
0
Comments on this Answer
Comment made 01-Dec-2014 by Michael Van Impe 77
Will try it out keep you posted about.. thanks
0
Comment made 12-May-2015 by Hari Kishore D 0
Did this work for you Michael. Am also looking for inserting x-forwarded-host and x-forwarded-proto into HTTP header. Hari
0