Forum Discussion

Yehsay_Moua_113's avatar
Yehsay_Moua_113
Icon for Nimbostratus rankNimbostratus
Nov 12, 2008

Need help to write iRule to modify hostheader

Hi all. I need some assistance with writing an iRule. I pretty much have the basics of writing redirects but here is something new that I'm not familiar with. How can I write a iRule to spoof or mask the incoming host entry to something else and send to a certain pool? I don't have any examples of the iRule to be so if anyone has done this, please share. Thanks.

 

 

So what I want to accomplish is:

 

 

browse to domain.com --> bigip --> pool as new_domain.com --> returns the requested page/information.

1 Reply

  • Hi,

    You can use HTTP::header replace Host "new_domain.com" to replace the existing host header value with the new domain:

     
     when HTTP_REQUEST { 
      
         Replace the existing host header with new_domain.com.  
         If there isn't an existing host header it will be inserted 
        HTTP::header replace Host "new_domain.com"  
     } 
     

    Aaron