Forum Discussion

ahmed_ismail_21's avatar
ahmed_ismail_21
Icon for Nimbostratus rankNimbostratus
Apr 02, 2016

iRule Script Request

please I need iRule match the below procedure.

 

1- Matching by Header " REFERER" section a- Match header " REFERER" contains vlaue MUSEPROXY=1103, then forward traffic persist to sr1 2- By URL pattern a- if URL pattern contains MUSEPROXY=1103, then forward traffic persist to sr1

 

3- By URL second value

 

a- if URL pattern contain .1103. then forward traffic persist to sr1

 

4-if nothing of policies match apply default load balancing " least connections "

 

1 Reply

  • Hi,

    The irule below may fit your request :

    when HTTP_REQUEST {
            switch -glob "[HTTP::header "Referer"]|[HTTP::uri]" {
                "*MUSEPROXY=1103*|*" -
                "*|*MUSEPROXY=1103*" -
                "*|*.1103.*" {
                    node srv1
                }
                default {
                     pool defined with least connection lb method
                    pool pool1
                }
            }
    }