Forum Discussion

puluck's avatar
puluck
Icon for Cirrus rankCirrus
Jan 13, 2018

HTTP proxy

Hello All,

 

we wanted to write irule for proxy the traffic to third party URL while client Header remains the same .

 

URL will be accessed by client ,based on URI part ( /London) it should send traffic to dev.example.com with out changing host header ( client address bar will be showing )

 

i tried several irule but nothing is working correctly. F5 can reach dev.example.com on 443.All communication is on https.

 

Can someone help here

 

Thank you

 

1 Reply

  • Try to use "Rewrite Profile" by creating a new one in "URI translation mode " and define client and server URIs in the rule as the following:

    client URI: http://www.abc.com/London
    server URI : https://dev.example.com
    

    or you can use this iRule

    when when HTTP_REQUEST {
     if { ([string tolower [HTTP::host]] eq "www.abc.com") 
     && ([string tolower [HTTP::uri]] contains "/london")  } {
    HTTP::header replace "Host" "dev.example.com"
    }
    }