Options

Basic HTTP Switching aFlex

Posted by kberton

What follows is a basic aFlex that will switch HTTP requests based on three different criteria -- User-Agent, URI and Host -- to the desired Service Group.

when HTTP_REQUEST {
if { [HTTP::header "User-Agent"] contains "Auto Installer"} {
pool sg_Auto_Installer
}
if { [HTTP::uri] starts_with "/en" } {
pool sg_http_en
} elseif { [HTTP::uri] starts_with "/lp" } {
pool sg_http_lp
} elseif { [HTTP::host] contains "mycompany.co.uk"} {
pool sg_http_uk
}
}

Comments

  • Options
    edited February 2014
    Posted by TODDH

    Slick, but when would I need to use this?

    What is the Auto-Installer?
  • Options
    edited February 2014
    Posted by kberton

    This came in handy for a customer that used a single vip/vport to conserve public IP addresses yet needed to switch to different pools based on the requested content. the "/en" rule sends users to the english language web site which is hosted on a separate pool of servers; "mycompany.co.uk" serves UK customers; etc, etc...

    Auto Installer is the user agent header used by their automated "phone home" update application that gets installed on all of their customers systems. the application updates are hosted on another set of web servers in the back end and setting the aFlex to trigger on UA was a big win for this customer to be able to handle the surges associated with new product updates.
Sign In or Register to comment.