Forum Discussion

Troy_93881's avatar
Troy_93881
Icon for Nimbostratus rankNimbostratus
Dec 14, 2009

http redirect + load balancing

Hey All,

 

 

I'm new to writing iRules and received a request I'm not sure is possible.

 

 

I need to redirect a http request -- but then load balance the redirects.

 

 

IE: User makes request for http://proxycfg.abcd.com/proxy/cfg.proxy

 

 

The F5 rewrites/redirects the request and sends it to either

 

 

http://1234proxy.abcd.com:8081/accel_pac_base.pac

 

 

or

 

 

http://1234proxy.bak.abcd.com:8081/accel_pac_base.pac

 

 

Can the F5 load balance the redirects to both locations listed?

 

 

Can this be done without an iRule?

 

 

I run version 9.4.7

 

 

Thanks,

 

 

TPG67

 

8 Replies

  • yes it can redirect either to either one to the conditions you set. Also if you are hosting http://proxycfg.abcd.com/proxy/cfg.proxy on say Bluecoat Proxy you can have the bluecoat redirect to http://1234proxy.abcd.com:8081/accel_pac_base.pac

     

     

    Bhattman
  • Thanks Bhattman,

     

     

    I think I can rewrite http://proxycfg.abcd.com/proxy/cfg.proxy to direct to one or the other -- but how do I redirect say half to one and half to the other?

     

     

    The 2 locations I directing traffic to are Bluecoat appliances.

     

     

    Thanks for help
  • Hi Troy,

     

     

    When you are redirecting I am assuming they are going directly to the bluecoats. Once you redirect in that scenario you lose the ability to track where they have gone from there since you have no idea what half of the clients are and half the other since they are not being redirected to a load balancer that can track the connections. Unless you can somehow base how you want to half the redirections. For example you want some subnets to go to one pacfile versus another.

     

     

    Is there any reason why you want half to go to one and the other half to another? Are they the same pacfiles? Are you trying to load balance the pacfiles?

     

     

    Bhattman

     

     

  • Thanks Bhattman,

     

     

    No -- not trying to load balance the pac files -- thats what I thought they were asking for. It would appear that there are two bluecoat appliances at different URL's that contain the same pac file. They want incoming requests to load balance between those two boxes. I'm just not sure why I would need to redirect at all vs just load balancing the request between the two boxes based on IP and port etc...
  • Bhattmann,

     

     

    I was incorrect in my last reply. The incoming request is for a proxy.cfg and must be rewritten for a pac file. The rewrite must then be load balanced to 2 bluecoat appliances. Is that possible?

     

     

    So basically -- the user makes a request for a proxy.cfg file -- the request is rewritten and load balanced to 2 URLS with accel pac files. The accel pac file is returned to the browser in the form of the original request.
  • It can be redirected. However, you need to determine how to discern the clients to determine which is redirected to pacfile A or B.

     

     

    There are several methods that come to mind

     

     

    Method 1) You could write up an irule that looks at the IP address of the client and redirects to Pacfile A on ODD IP numbered clients and Pacfile B on even numbered clients. It won't guarantee evenness but it might be close depending on how your clients are split up.

     

     

    Method 2) Create 2 Virtual addresses 2 virtual address that can host http://proxycfg.abcd.com/proxy/cfg.proxy. One VS redirects to pacfile A and the other to pacfile B. Then create in your DNS a round robin entry for proxycfg.abcd.com.

     

     

    Method 3) Create irule where you identify several subnets you want to go to redirect to pacfile A and other subnets to pacfile B

     

     

    thoughts?

     

     

    Bhattman

     

  • Thanks Bhattman,

     

     

    Appreciate those suggestions -- I will play around with the ideas and if I get it working I will post on here.

     

     

    If I get stuck -- I'll post what I have to see if you can help out. With Holidays upon us -- will probably not be working the issue until early January.

     

     

    Thanks again,