Forum Discussion

Dan_19349's avatar
Dan_19349
Icon for Nimbostratus rankNimbostratus
Apr 18, 2011

Trying to use as a reverse proxy

Hello and thanks in advance for any help.

 

I think what I'm trying to do is somewhat basic but I'm new to the F5 and iRules. Basically, I want an incoming request (abc.def.com/appA/resource1) to be sent to pool-appA (if it exists) and then the iRule should strip off "appA" when sending the request to the backend server. The basic traffic would be:

 

 

Browser request (abc.def.com/appA/resource1) ---> F5 --> iRule --> Pool-appA ---> (webserver) /resource1

 

 

Then when it goes back to the browser the request should get "put back together" inserting "appA" for the ongoing traffic and transactions.

 

I'm using V10.2

 

 

Thanks,

 

Dan

6 Replies

  • Colin_Walker_12's avatar
    Colin_Walker_12
    Historic F5 Account
    Will you be doing this for multiple applications, or is AppA the only app you're doing this for?

     

     

    I ask because while removing the string from the inbound request is easy, it will be a bit more difficult to know which string needs to be re-inserted on the outbound response if there are multiple applications, and will require very different code.

     

     

    Colin
  • Hi Colin,

     

     

    Yes, this is for multiple applications. 300+ and growing.

     

    Could this be done with an iRule and then, when appB - C, D, E, etc. is added, I would then create a new pool for the new application webservers?
  • Colin_Walker_12's avatar
    Colin_Walker_12
    Historic F5 Account
    You could certainly do it that way. That would make the iRule logic much simpler, as there would be no need to figure out which app name to re-insert on the response. That would, of course, make your overall configuration more complex I would think though. Having 300+ virtuals where you would otherwise have 1 might be a bit more cumbersome than you want.

     

     

    Is that a realistic solution? This should be possible with some iRules trickery on a single VIP, it just makes things a bit ... stickier.

     

     

    Colin
  • I'm thinking 1 virtual...1 iRule...and 300+ pools that map to their respective backend webservers. But I'm definitely open to suggestions.

     

    Realistic? That's also open for debate :-)
  • Any thoughts on an iRule to accomplish something like this?

     

     

    Thanks,

     

    Dan
  • I'm not sure that you would like the performance hit you might take for configuring an iRule to route traffic for 300 Pools.

     

     

    The routing logic would have to run for every request, so you would pay for the functionality with latency.

     

     

    It might be acceptable (some of the others can might be able to verify), but I haven't ever attempted anything like that.

     

     

    For the incoming URI modification, you could do that with a string map replacement and it should hold and run fine unless you are doing some type of redirect, and then you would need to rewrite the Location in the Response Header.

     

     

    http://devcentral.f5.com/Tutorials/TechTips/tabid/63/articleType/ArticleView/articleId/339/iRules-101--14--TCL-String-Commands-Part-2.aspx