Forum Discussion

ScottM's avatar
ScottM
Icon for Nimbostratus rankNimbostratus
Aug 30, 2019

URL rewrite, pool assignment and uri insert in one rule

Hello,

 

Apologies for another URL rewrite, but I have searched and have been unable to find an answer for this situation. I'm a newb with the F5 and would greatly appreciate any assistance.

 

We have a VS with several polices/rules in place to direct traffic to different pools based on the URI. This case is different in that the host in the URL is different and the URI will contain varying text, no real way to base rule off of the URI, but the domain is the same.

 

So, request comes in for https://sub-domain.domain.com/text/moreText. What we need is to direct this traffic to a specific pool and prepend the URI with /addedText. The rewrite should remain transparent to the users.

 

In other words, users navigate to https://sub-domain.domain.com/text/moreText -> F5 sends traffic to pool abc123 as https://node in pool/addedText/text/moreText -> user still sees URL in their browser as https://sub-domain.domain.com/text/moreText

 

Is this even possible?

2 Replies

  • Hi ScottM,

    when HTTP_REQUEST {
        if { ([HTTP::host] equals "sub-domain.domain.com") && ([HTTP::uri] starts_with "/text/moreText") } {
            HTTP::uri "/addedText[HTTP::uri]"
            pool abc123
        }
    }
  • ScottM's avatar
    ScottM
    Icon for Nimbostratus rankNimbostratus

    Thank you very much! Appreciate you taking the time to answer my question!