Forum Discussion

Mohammad_1363's avatar
Mohammad_1363
Icon for Altocumulus rankAltocumulus
Jun 30, 2021

Redirect incoming HTTPS request on on prem F5 to AWS ELB

Hello F5 Guru

I have a requirement to redirect incoming https traffic for one of my application to AWS, so when the https request is coming and hitting my VIP on F5 which is on local datacenter that traffic should get redirected to the application which is in AWS.

Please help me to write an iRule for that.

 

when HTTP_REQUEST {

 if { [string tolower [HTTP::uri]] starts_with "/x/y/" or [string tolower [HTTP::uri]] starts_with "/xx/yy/"} {

       here i need a to do something to redirect the traffic to AWS ----- > Please help

 } else {

         pool pool-xyz-http

 }

}

1 Reply

  • Hi  ,

    You can try below irule. You need to put specific url in place of aws-url-path where you want to redirect matched requests.

    when HTTP_REQUEST {
     
    if {([HTTP::uri] starts_with "/x/y/") || ([HTTP::uri] starts_with " /xx/yy/") {
        HTTP::redirect "https://aws-url-path"
    } else {
        pool pool-xyz-http
    }
     
    }

    Hope it helps!