Forum Discussion

kristine_v's avatar
kristine_v
Icon for Altostratus rankAltostratus
Sep 15, 2023

Rewrite Profile - 1 client URI maps to 2 server URIs

The requirement is to have a rewrite profile that has the same client URI that  is mapping to 2 server URIs. Tried creating it but there is an error saying Configuration error: Client URI must be unique.

Example:

Client URI:

https://api01.apigateway.test.com:5001

Server URI:

api22.test.com:443

api23.test.com:443

 Is there a way for this to be configured? or what can I do to achieve the needed configuration?

3 Replies

  • kristine_v I'm not aware of an easy way to do a stringmap of 1 name to 2 unique names. Any particular reason pool members can't be changed to accept requests for api01.apigateway.test.com instead of requiring api22 and api23.test.com for the respective pool member? This seems like a very complex bandaid on the F5 when the server should be able to be configured to accept request on the original FQDN.

    • kristine_v's avatar
      kristine_v
      Icon for Altostratus rankAltostratus

      Hi, Paulius thank you for the information. This is a requested additional configuration by the end-user. Sadly, we're not given much details on why this must be resolved in the F5 side. 

      • Paulius's avatar
        Paulius
        Icon for MVP rankMVP

        kristine_v I recommend going back to the end user and explaining why it shouldn't be done on the F5 and push them to make the adjustment on the server side. Just because something can be done on the F5 does not mean that it's the best approach, especially with this request. You might try the following iRule but I have never had to perform a modification to the HTTP header after the pool member has been selected. If you have more than 2 pool members then you would add in an "elseif" for each additional pool member. In the following you will replace x.x.x.x with the pool members IP for api22.

        when HTTP_REQUEST_SEND priority 500 {
        
            if { [IP::server_addr] == "x.x.x.x" } {
                HTTP::host [string map {"api01.apigateway.test.com" "api22.test.com"}[HTTP::host]] 
            } else {
                HTTP::host [string map {"api01.apigateway.test.com" "api23.test.com"}[HTTP::host]]
            }
        
        }