Forum Discussion

Terrence_112415's avatar
Terrence_112415
Icon for Nimbostratus rankNimbostratus
Oct 09, 2008

Rewrite Host based on Pool Member

Hi, I have been searching but haven't found out how to do this.

 

 

What we need is a way to rewrite the host based on which pool member the F5 is load balancing to.

 

 

For example:

 

 

User will type in the address app.test.com that will his the VIP for the application, the F5 will load balance to a specific server

 

SERVER1 or SERVER2

 

If it chooses SERVER2 we would like the iRule to rewrite the host to app02.test.com and it chooses SERVER1 then we would like the iRule to rewrite the host to app01.test.com

 

 

Does anyone know how to do this?

1 Reply

  • Hi Terrence,

     

     

    Check this post for an example (Click here). You can strip out the URI logic and just rewrite the Host header using 'HTTP::header replace Host "newhost.example.com"'.

     

     

    Reply here if you get stuck.

     

     

    Aaron