Forum Discussion

Billy_10041's avatar
Billy_10041
Icon for Nimbostratus rankNimbostratus
Apr 08, 2013

Write iRule to redirect same node different port

Need help writing iRule to be use on multiple server where if url contains sso then it get redirected to node on port 8382 else it get redirected to same node on port 443. Would like a iRule that would be use all servers.

 

2 Replies

  • Can I assume that the port 443 node is SSL and the port 8382 node is not? If so, you need to apply a server SSL profile to the virtual server and use an iRule like this:

     

     

    
    when HTTP_REQUEST {
      if { [HTTP::uri] contains "sso"}{
        SSL::disable serverside
        node 1.1.1.1:8382
      } else {
        node 1.1.1.1:443
      }
    }
    

     

     

    The above code makes a few more assumptions. It may be easier to define separate pools (one with port 8382 members and another with port 443 members) and use pool statements instead of node. This way you can properly load balance multiple servers. Also, did you specifically mean that the port 8382 connection had to go to the SAME node that the client may have been previously attached to on port 443?