Forum Discussion

chief_rocka_334's avatar
chief_rocka_334
Icon for Nimbostratus rankNimbostratus
Jun 01, 2018

Is it possible to route traffic in an if statement to a single IP and port without doing a redirect?

I have this right now but this redirects the browser to the IP which is not accessible by the browser, it's only visible to LTM. I was hoping for a way that just passes the request to the new IP without a redirect.

when HTTP_REQUEST {
    if { [string tolower [HTTP::path]] starts_with "/wrongpath" } {
        HTTP::redirect https://172.18.188.11:7777[HTTP::uri]
    }
}

1 Reply

  • Yes, this is possible. You can a an second pool with pool member 172.18.188.11:7777 and use a LTM policy to forward traffic to this pool when the URI starts with /wrongpath.

    Or you could use an iRule like:

    when HTTP_REQUEST {
        if { [string tolower [HTTP::path]] starts_with "/wrongpath" } {
            pool pool_7777
        }
    }