Forum Discussion

Sam10's avatar
Icon for Altostratus rankAltostratus
Jul 28, 2020

doamin replacement irule

I am trying to get logic for a domain replacement. When external users access * F5 need to replace the domain with * and send the request to the pool members. is not advertised externally,so i need F5 to do the domain replacement so the backend servers can process the traffic.

1 Reply

  • This is what i am trying to acheive. not getting my logic correct in irule.


    User types in , f5 need to replace that with and send it to the back end server ,

    and when backend server sends the response F5 need to again replace the request with as client should not see the anywhere the internal domain in the header.



    when HTTP_REQUEST {


           set external_hostname "*"        

           set internal_hostname "*"   

           HTTP::header replace "Host" $internal_hostname       




          when HTTP_RESPONSE {        

           if { [HTTP::header value "Location"] ends_with "$internal_hostname" }{


               set location [HTTP::header location]


               HTTP::header replace location $external_hostname