30-Jun-2021 00:11
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
}
}
30-Jun-2021
01:33
- last edited on
04-Jun-2023
19:23
by
JimmyPackets
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!