Forum Discussion

Brett_Channon_1's avatar
Brett_Channon_1
Icon for Nimbostratus rankNimbostratus
Feb 23, 2007

Redirect to a pool and change port

Hi all,

 

 

After having not looked at irule's for a while i'm somewhat slow at getting back in to it and so would appreciate some help.

 

 

I want to take a port 80 HTTP request and if the uri matches xxx then to rewrite the request to go to port 9999 on a a set of servers in a pool.

 

 

I can write the irule to do the uri check and pool direction but am unsure about the changing of the destination port (i have already set up the nodes so they are listening on that port in that specific pool)

 

 

Any ideas appreciated.

 

 

Thanks

 

 

Brett

2 Replies

  • you could create another pool that has members defined with port 9999...

    
    when HTTP_REQUEST {
      if { [string tolower [HTTP::uri]] contains "xxx" } {
        pool newPool
      }
    }

    Or you could do something like this:

    
    when LB_SELECTED {
      if { [string tolower [HTTP::uri]] contains "xxx" } {
        pool [LB::server pool] member [LB::server addr] 9999
      }
    }
  • Thanks.

     

     

    I now need to do some more research though as it appears that the client now talks directly to the node rather than the request being proxied through the F5 box. The browser also shows the node address rather than the F5 VIP the client came through on. Not sure whats causing this..