Forum Discussion
Julian_Grunnell
Nimbostratus
Jul 24, 2008Rewriting HOST header
Hi - can someone offer some help, I've got a request to do some header rewriting and have a rough idea of how to do this but hoping someone has done this before!!
I need to have an iRul...
Nicolas_Menant
Employee
Jul 24, 2008Hi,
To make it easier you should specify a class that will specify for each host, what should be the replacement value and then use the command findclass
You can find a reference to this command here: Click here
It would look like this (the class define below should be define as a datagroup)
class dest_pairs {
" proxy"
"admin.site1.com www.mysite.com"
"admin.site2.com www.mysite2.com"
}
when CLIENT_ACCEPTED {
set my_dest [findclass [HTTP::host] $::dest_pairs " "]
if { $my_destl ne "" } {
HTTP::header replace Host $my_dest
}
}
If you have a BIGIP 8XXX you should replace $::dest_pairs by ::dest_pairs in order not to demote CMP. (you need to have a v9.4.2 version to do so)
HTH
Recent Discussions
Related Content
DevCentral Quicklinks
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com
Discover DevCentral Connects