Forum Discussion

tarsier_90410's avatar
tarsier_90410
Icon for Nimbostratus rankNimbostratus
Sep 21, 2011

modify HTTP profile in iRule?

Is it possible to either change the HTTP Profile being used, or change the properties of the HTTP Profile for a connection using an iRule? Based on scope, I'd expect this change to only be valid in events that execute prior to the HTTP_REQUEST, like CLIENT_ACCEPTED.

 

 

 

 

My goal is to use a different HTTP Profile based on the IP range a user comes from, rather than deploying multiple virtual servers with individual HTTP Profiles. Currently, for each application we host one VS for LAN users, one VS for WAN users, and one VS for Internet users. Obviously hosting 3 (or more based on some rumblings from specific WAN sites) VSes for one application should be unnecessary overhead. By combining the VSes into one with some iRule logic, our time spent managing everything will be greatly reduced, including the use of geo-location for our internal/WAN DNS.

 

  • You can't select an HTTP profile from an iRule, but you can configure a lot of the HTTP profile properties dynamically from an iRule. Can you give a bit more detail on what specifically you want to change from the iRule?

     

     

    Aaron
  • Specifically I would like to enable compression for one set of client IP's (users with a slow WAN link), but disable it for LAN users.
  • Hi tarsier,

     

     

    Modify the Compression Setting on the HTTP Profile to "Selective" and use the COMPRESS::enable inside of your iRule condition.

     

     

    http://devcentral.f5.com/wiki/iRules.COMPRESS__enable.ashx