Forum Discussion
Mike_129800
Jul 08, 2013Nimbostratus
Thank you, so something like this for the iRule:
when HTTP_REQUEST {
switch [string tolower [HTTP::uri]] {
/sto { set newhost "sto.domain";set newnode "200.200.200.101" }
/cph { set newhost "cph.domain";set newnode "200.200.200.102" }
/bru { set newhost "bru.domain";set newnode "200.200.200.103" }
/jnb { set newhost "jnb.domain";set newnode "200.200.200.104" }
default {
do something
}
}
HTTP::header replace Host $newhost
HTTP::uri [string map -nocase {sto WOS} [HTTP::uri]]
HTTP::uri [string map -nocase {cph WOS} [HTTP::uri]]
HTTP::uri [string map -nocase {bru WOS} [HTTP::uri]]
HTTP::uri [string map -nocase {jnb WOS} [HTTP::uri]]
node $newnode 6500
}
I want to only replace part of the URL i.e. sto, cph, bru, jnb with WOS will the above work for that?
The set newnode "200.200.200.101" should that be the IP of new host or is it something else?
What is the virtual bar config for in the above example?
I am setting this up via the GUI.
Thanks,
Mike