Forum Discussion
redirecting traffic to individual members based on condition
Http Request for Mobile will have header as “DEBUG_INDICATOR” with value “true” then request must go to In-Active member else go to Active member.
Pool 1: Primary Pool 1.1.1.1 ( Datacenter 1 is Active) 1.1.1.2 ( Datacenter 2 is In-Active)
Pool 2: Secondary Pool 1.1.1.1 ( Datacenter 1 is Active) 1.1.1.1 ( Datacenter 2 is In-Active)
- Kevin_Stewart
Employee
How are you defining if a datacenter is active or inactive?
- Vish04_293402
Nimbostratus
It's theoretically, in actual everything will be up and working.
- Vish04_293402
Nimbostratus
I thought of something like this;
when HTTP_REQUEST { if { [HTTP::header exists DEBUG_INDICATOR] and [HTTP::header DEBUG_INDICATOR] equals "true" } { node 1.1.1.1 set url [HTTP::header Host][HTTP::uri] set vip [IP::local_addr]:[TCP::local_port] foreach aHeader [HTTP::header names] { log local0. "HTTP REQUEST HEADER $aHeader: [HTTP::header value $aHeader]" } } }
Not sure if this is the correct method for creating this IRule
- Kevin_Stewart
Employee
I'm not sure what the 'set url' and 'set vip' statements are doing here, but everything else seems reasonable.
when HTTP_REQUEST { if { ( [HTTP::header exists DEBUG_INDICATOR] ) and ( [HTTP::header DEBUG_INDICATOR] equals "true" ) } { pool1 } else { pool2 } }
Recent Discussions
Related Content
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com