Forum Discussion

Ravish_Patel_31's avatar
Ravish_Patel_31
Icon for Nimbostratus rankNimbostratus
Nov 08, 2018

url re-write and direct it to pool

currently i have one Virtual server and different http requests are redirected to different pools using SNI. i.e host url is matched and then http traffic is forwarded (forward traffic in local policy) to their respective pool. is there a way, where, when a request hits VS (request url: http://httprequest.com. before forwarding it to server, i want to add uri. for e.g http://httprequest.com/loc1/loc2 and then point it to a particular pool. i want to accomplish this using sni as same virtual server is being used for other url. i want to add uri because http://httprequest.com/loc1/loc2 is the actual url of webpage. if i dont include uri then i can see windows iis page.

 

Thanks

 

1 Reply

  • Hi Ravish,

    Try this, use the string map to map the / with the new uri /loc1/loc2/.

    when HTTP_REQUEST {
      switch -glob [string tolower [HTTP::host]] {
        "httprequest.com" {
          HTTP::uri [string map {/ /loc1/loc2/} [HTTP::uri]]
        }
      }
    }