URL Rewrite

Hi,

We want to have a VIP A to accept traffic on port 80 and listen to http://www.xyz.com. Then the http request needs to be rewrited depending on the node that will process the traffic. If node A takes the traffic the request needs to be http://www.abc.com. If node B takes the traffic the request needs to be http://www.def.com. There will only be 1 node enabled in the pool. Nodes will be disabled/enabled manually in the pool. How should my I-rule look like?

Thanks in advance

Tom

Hi Tom,

You can use something like this to rewrite the host header based on the selected pool member:

when HTTP_REQUEST_SEND { 
  
     Force evaluation in the clientside context 
    clientside { 
  
        Check the requested pool member 
       switch [IP::server_addr] { 
          1.1.1.1 { 
             HTTP::header replace Host "www.abc.com" 
          } 
          default { 
             HTTP::header replace Host "www.def.com" 
          } 
       } 
    } 
 }

Aaron