Forum Discussion

John_Ogle_45372's avatar
John_Ogle_45372
Icon for Nimbostratus rankNimbostratus
Mar 18, 2010

host field rewrite help needed

I have just tried using this iRule but it is not rewriting the host field in the GET requests as expected. I did a tcpdump on the pool side to verify. I need to have the host field appeneded to include :83 before the packet hits the server.

 

 

when HTTP_REQUEST {

 

if { [HTTP::host] equals"xyz.company.com"} {

 

HTTP::header replace Host "xyz.company.com:83"

 

}

 

}

 

 

 

What am I doing wrong? Any assistance would be much appreciated.
  • This looks OK to me, and I just ran a quick test with some logging added:

     
      when HTTP_REQUEST { 
     log local0. "Host is: [HTTP::host]"  
     if { [HTTP::host] equals"xyz.company.com"} { 
     HTTP::header replace Host "xyz.company.com:83" 
     log local0. "New host header is: [HTTP::header Host]" 
     } 
     }  
     

    ...Which produces in the logs.

    Mar 1 16:39:26 local/tmm info tmm[3994]: Rule dc-generic : Host is: xyz.company.com

    Mar 1 16:39:26 local/tmm info tmm[3994]: Rule dc-generic : New host header is: xyz.company.com:83

    -Matt