Forum Discussion
Need Irule to replace http host based on pool member
when CLIENT_ACCEPTED {
if { [IP::addr [LB::server addr] equals $xyz] }{
set server xyz
}
if { [IP::addr [LB::server addr] equals $def] }{
set server def
}
}
when HTTP_REQUEST {
STREAM::disable
HTTP::header remove "Accept-Encoding"
if {$server == xyz} {
HTTP::header replace "Host" "xyz.com"
}
if {$server == def} {
HTTP::header replace "Host" "def.com"
}
}
when HTTP_RESPONSE {
if { [HTTP::header Location] contains "xyz.com" } { HTTP::header replace Location [string map {"xyz.com" "abc.com"} [HTTP::header Location]] }
if { [HTTP::header Location] contains "def.com" } { HTTP::header replace Location [string map {"def.com" "abc.com"} [HTTP::header Location]] }
if {[HTTP::header value Content-Type] contains "text"}{
STREAM::expression {@xyz.com@abc.com@@def.com@abc.com@}
STREAM::enable
}
}
Recent Discussions
Related Content
* 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