For more information regarding the security incident at F5, the actions we are taking to address it, and our ongoing efforts to protect our customers, click here.

Forum Discussion

kamlyada_209668's avatar
kamlyada_209668
Icon for Nimbostratus rankNimbostratus
Oct 01, 2015

Need an Irule for the below url--request and suggestion

Hello All,

 

what requires is mentioned below.

 

https://uat.toolboxbo.kamlesh.com/toolbox Shoud redirect to http://cfrsv50143005ap.p2-eu.kamlesh.net:9080/toolbox

 

https://uat.toolboxbo.kamlesh.com/toolbox?example=123 Shoud redirect to http://cfrsv50143005ap.p2-eu.kamlesh.net:9080/toolbox?example=123

 

General rule: everything after the / should be keeped in the redirection

 

https://uat.toolboxbo.kamlesh.com/somethingelse Shoud redirect to http://cfrsv50143005ap.p2-eu.kamlesh.net:9080/somethingelse

 

This is the requirement. Could someone please suggest on the same. Thanks in advance.

 

4 Replies

  • Try this;-

    when HTTP_REQUEST {
       if {[HTTP::host] eq "uat.toolboxbo.kamlesh.com"} {
          HTTP::respond 301 Location "http://cfrsv50143005ap.p2-eu.kamlesh.net:9080[HTTP::uri]" Connection "close" noserver
          return
       }
    }
    
  • @ IheartF5 -- Thanks for all your help its working fine.

     

    Redirection is good and working for both Url with above IRule but client wants to keep original url in the browser. Means need to redirect both the url above and also keep original url in browser in both cases of redirection. Could someone please suggest on the same. Thanks in advance.

     

  • OK so it's not a redirect you want - it's a proxy. You don't need an iRule for this

     

    • Create a pool pl_cfrsv50143005ap.p2-eu.kamlesh.net_9080 with member x.x.x.x:9080, where x.x.x.x is the IP that cfrsv50143005ap.p2-eu.kamlesh.net resolves to
    • Create a virtual server vs_uat.toolboxbo.kamlesh.com_https with a clientsssl profile and pool pl_cfrsv50143005ap.p2-eu.kamlesh.net_9080 attached