Forum Discussion

kazeem_yusuf1's avatar
kazeem_yusuf1
Icon for Nimbostratus rankNimbostratus
Feb 24, 2017

AN IRULE THAT ADDS A STRING TO HTTP REQUEST OR RESPONSE (POOL MEMBER ALONE DOESN'T LOAD)

I got a request from a customer for ssl offload to their website.(using tomcat engine) Ordinarily, this isn't hard. However, their pool members don't load on their ip:port combination.

 

Both pool members are 172.30.114.56:8080, and 172.30.114.58:8080. However, none of them loads as a webpage, when type that on my browser.

 

They only work when 172.30.114.56:8080/arsys OR 172.30.114.58:8080/arsys, is typed into the browser.

 

What irule, can i use to add a string to any pool member chosen.

 

Like, if 172.30.114.56:8080 is chosen, it will automatically return, 172.30.114.56:8080/arsys, or 172.30.114.58:8080/arsys.

 

I tried the below irule, but its not working.

 

NOTE: VIP is 172.30.114.60.

 

when HTTP_REQUEST { if { [HTTP::host] equals "172.30.114.60" and [HTTP::uri] starts_with "/" } { HTTP::redirect "http://172.30.114.58:8080/arsys"; } }

 

I want to try this for http VS first, to test its usability,then use it for HTTPS.

 

  • Actually, and just to use the correct wording, you will not append a string to a pool member because selecting a pool member is a load balancing decision, then comes the http protocol manipulation which is done at layer 7 either on the client side or server side connections, examples are redirection and uri rewriting. So, the correct expression is to append a string to a http request or response.

     

    And to answer the question, yes a redirection iRule will do the job, assuming you have a http profile associated to the VS.

     

    However, your condition [HTTP::uri] starts_with "/" is always true so you will end with a redirection loop. Try with [HTTP::uri] equals "/"