Forum Discussion

Jon_Sumpster_37's avatar
Jon_Sumpster_37
Icon for Nimbostratus rankNimbostratus
Oct 24, 2018

Port forwarding based on FQDN and URI match

Hi,

 

I'm splitting a web application into two instances to allow them to organically change over time without impacting each user community.

 

At the moment, the F5 uses the FQDN to forward to the web application port (55543). When I have two web applications, I want to use the same FQDN, but forward to a different port with as little impact to users as possible. As a result, I would like to include some form of URI matching to additionally determine the port to forward to, for example;

 

--> port 55543 (existing web application) --> port 55544 (new web application)

 

I'm not sure if it's best/required to explicitly include a 'URI does not contain "/new"' condition for the existing web application (55543) and to include a 'URI contains "/new"' condition for the new web application (55544).

 

For info, the FQDN maps to a pool of two web servers, which will be configured identically for resilience purposes.

 

I'm sure this is straightforward, but could do with a few pointers please.

 

Kind regards

 

Jon

 

    • Create two pools, one for each set of instances listening on the respective application port (55543 and 55544).

    • Create a simple iRule that switches between them based on URI:

      when HTTP_REQUEST {
          switch -glob [string tolower [HTTP::uri]] {
              "/new*" {
                  pool pool_55544
              }
              default {
                  pool pool_55543
              }
          }
      }
      
    • Enable OneConnect on the VIP if you expect users to be flipping between the pools mid-session.