Forum Discussion
Kai_Wilke
Jan 26, 2016MVP
Hi bigipjr28,
a sample code would look like this...
when HTTP_REQUEST {
if { [set temp(virtual) [URI::basename [virtual name]]] starts_with "DC_" } then {
if { [set temp(host) [class match -value $temp(virtual) equals DG_VIRTUAL_2_HOST]] ne "" } then {
HTTP::header remove Host
HTTP::header insert Host $temp(host)
} else {
The Datagroup doesn't have a match.
Add additional code here to handle those exeptions or simply let the requests pass.
}
} else {
HTTP::header remove Host
HTTP::header insert Host $temp(virtual)
}
unset -nocomplain temp
}
Note: I haven't had the chance to test the actual code. So please bear with me if minor syntax errors (e.g. missing braces, etc.) are left... 😉
Cheers, Kai