Forum Discussion

ToddF_388256's avatar
ToddF_388256
Icon for Nimbostratus rankNimbostratus
Apr 10, 2019

iRule for sending different types of traffic regardless of port to different locations?

Here is the pseudo code for what I'm trying to do:

 

Regardless of the port arriving at F5 virtual server

 

If http, https, wss Redirect to some.url.com

 

Else /All other TCP traffic / Redirect to some.hostname.com

 

Is this possible?

 

Thank you, Todd

 

1 Reply

  • You would need to configure a virtual server to listen on all ports and use an iRule such as the one below to redirect depending on the incomming port

    when HTTP_REQUEST {
        switch [TCP::local_port] {
            "80" -
            "443" - {
                HTTP::redirect https://some.url
            }
            default {
                HTTP::redirect https://someother.url
            }
        }
    }