So you need to match on the Host AND the URI? You will have to use a comparison for the Host AND the URI parts. HTTP::host and HTTP:uri will return those parts of the request. The Host being an IP address verses an FQDN does not matter...you can match either of those.
Comments
Are you looking for something like this: https://community.a10networks.com/discussion/16945/redirect-302-with-aflex
Yes, but how can I do it to take the request when it comes with an IP, less so https://200.125.55.34/URI I need to redirect that request
So you need to match on the Host AND the URI? You will have to use a comparison for the Host AND the URI parts. HTTP::host and HTTP:uri will return those parts of the request. The Host being an IP address verses an FQDN does not matter...you can match either of those.
Unfortunately I don't have a HOST or FQDN, it's only published by IP and URI and I want to redirect it elsewhere, I don't know if it will be possible.
I was able to do the redirect, only with the URI of the site, regardless of whether it comes with HOST or IP, this is how I built it.
when HTTP_REQUEST {
if { [HTTP::uri] equals "/URI/*" } {
HTTP::redirect https://misitio.otro.com
}
}
maybe a little late but you can accomplish this with a slb http template
example:
slb template http redir
redirect location https://misitio.otro.com
output from curl
< HTTP/1.1 302 Found
< Location: https://misitio.otro.com
< Connection: close