Forum Discussion

pvaughan's avatar
pvaughan
Icon for Nimbostratus rankNimbostratus
Nov 20, 2013

Need help with Irule to redirect based on http path or host header

I need to create an irule that will redirect traffic to a different pool bassed on the following criteria. The http path begins with /socket.io OR ((The http header 'Upgrade' contains the string 'WebSocket') AND (the http header 'Host' begins with 'ws')). This is what I have so far, any help is appreciated.

 Assign a pool HTTP path

when HTTP_REQUEST {
    switch -glob [string tolower [HTTP::path]] { 
        "/socket.io*" {
         select the pool 
            pool poolA

    }

elseif HTTP::request {
    switch -glob [string tolower [http_host]] contains { "

19 Replies