Forum Discussion
Redirect request to specific node depending on the header value..
I have created the irule as below to redirect the request to specific node depending on the header vaules.. getting some error as below.. so could you please suggest. i am not familier with irule creations. rule irule_oa_uiws { when HTTP_REQUEST { if { [HTTP::header "x-oa-uiws"] equals "Server1" } { node 10.205.79.135 80 } elseif { [HTTP::header "x-oa-uiws"] equals "Server2" } { node 10.205.79.136 80 } else { pool OAPPE-UI-EXT-80 } } }
Getting error as below: 01070151:3: Rule [irule_oa_uiws] error: line 2: [missing a script after "if"] [] line 3:[undefined procedure: node 10.205.79.135 80] [{node 10.205.79.135 80}] .....etc...
2 Replies
- Hamish
Cirrocumulus
An error when?
A quick copy & paste into a Lab/VE works fine syntax wise for me...
Ahh... Are you trying to add this via tmsh? You probably need to quote it if you are...
H
- nitass
Employee
so can you please alter the irule or provide the new irule which forward the request to nodes on the bases of header values.
as Hamish mentioned, the irule syntax looks okay.
root@(ve11a)(cfg-sync In Sync)(Active)(/Common)(tmos) list ltm rule irule_oa_uiws ltm rule irule_oa_uiws { when HTTP_REQUEST { if { [HTTP::header "x-oa-uiws"] equals "Server1" } { node 10.205.79.135 80 } elseif { [HTTP::header "x-oa-uiws"] equals "Server2" } { node 10.205.79.136 80 } else { pool OAPPE-UI-EXT-80 } } }
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)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