Forum Discussion

Simon_Ecoffey_8's avatar
Simon_Ecoffey_8
Icon for Nimbostratus rankNimbostratus
Nov 29, 2006

Redirect on different tcp port without modifying user's browser

Hello,

 

 

I have to loab balance http traffic for 2 reverse proxy. The requirement are to redirect on different TCP port based on the url.

 

URL https://mysite.com/searchxpl redirect to http://mysite.com:8000/searchxpl

 

URL https://mysite.com/dimpweb redirect to http://mysite.com:8001/dimpweb

 

URL https://mysite.com/platcom redirect to http://mysite.com:8002/platcom

 

and so on for each application hosted on the reverse proxy

 

The client url should remain https://mysite.com/searchxpl

 

Is it possible to do that redirection without modifying the client with irules

 

 

Thanks

3 Replies

  • You can create a pool containing the server(s) answering for port 8000 (like http_8000_pool) and another for the servers on port 8001, etc.

    You could then use a rule to set the pool to http_8000_pool for requests with an HTTP::uri starting with "/searchxpl", etc.

    As the client is making requests via HTTPS, you would need to decrypt the SSL using a client SSL profile on the VIP.

    A simple example would be:

    
    when HTTP_REQUEST {
       if {[HTTP::uri] starts_with "/searchxpl"}{
           URI started with /searchxpl, send to http_8000_pool
          pool http_8000_pool
       }
       elseif {[HTTP::uri] starts_with "/dimpweb"}{
           URI started with /dimpweb, send to http_8001_pool
          pool http_8001_pool
       }
       elseif {[HTTP::uri] starts_with "/platcom"}{
           URI started with /platcom, send to http_8002_pool
          pool http_8002_pool
       }
       else {
           URI didn't match, take some default action
          pool default_pool
       }
    }

    Aaron
  • I should add that BIG-IP will by default perform port translation between the port the client makes a request to and the port the node is configured on. So you don't have to deal with this part in a rule. Check the config guide of the online help on the VIP properties page for details on port translation.

     

     

    Aaron