Forum Discussion

Sinistrad_29710's avatar
Sinistrad_29710
Icon for Nimbostratus rankNimbostratus
Feb 16, 2017

Apply an iRule for only a specific pool from a VS

Hi,

I need to apply this iRule to a specific pool, but do not want to impact the other pools in my VS :

when HTTP_REQUEST {

STREAM::disable HTTP::header remove "Accept-Encoding" } when HTTP_RESPONSE {

if {[HTTP::header value Content-Type] contains "text"}{

  STREAM::expression {@http://@https://@}

  STREAM::enable

} }

Can we do it from the webgui ? Or should i add a specific line in my iRule to apply it only on this URL : "alfons-pp.domain.com"

2 Replies

  • You are better off using an if-condition for specific domain - alfons-pp.domain.com

    LB::server pool
    gives you the pool of the currently selected member. You can probably use an if-condition to activate the iRule if specific pool is selected, if you are looking for a possible alternate option.

  • Hi,

    you can set a variable to define you want the stream to apply:

    when HTTP_REQUEST {
        STREAM::disable 
        if { [HTTP::host] eq "alfons-pp.domain.com" } {
            set stream_string {@http://@https://@}
            HTTP::header remove "Accept-Encoding" 
        } 
    }
    
    when HTTP_RESPONSE {
        if { ([HTTP::header value Content-Type] contains "text") and [info exists stream_string]} {
            STREAM::expression $stream_string
            STREAM::enable
        } 
    }