Forum Discussion
gaza_104946
Jul 27, 2011Nimbostratus
HTTP::path not updating within iRule
Running 10.2 HF2
I originally had a iRule that was rewriting incoming requests
if { [HTTP::path] equals "/abc" } {
log local0. "[virtual name] [IP::client_addr] detected old path /abc and modified to /xyz"
HTTP::path "/xyz"
}
Which was working fine and the back-end server was seeing /xyz
I then need to LB to different back-ends based on the path and added this extra code
switch -glob [HTTP::path] {
"/abc" { pool pool_abc }
"/xyz" { pool pool_xyz }
}
What I found is that the correct pool was not being used.
I then moved the 2nd set of code to another iRule which was placed after the original iRule for the VS and it worked!!
Further investigation showed that if you set HTTP::path within an iRule that you don't get the new value, but a following iRule will get the new value.
Is there a way I can get around this as I'd like to simplify the configuration back into a single irule?
Note: that this is not the only code in the iRule or the only iRule, so I really am looking for a code solution rather than using HTTP classes.
- hooleylistCirrostratusHi Gaza,
when HTTP_REQUEST { if { [HTTP::path] equals "/abc" } { log local0. "[virtual name] [IP::client_addr] detected old path /abc and modified to /xyz" set path "/xyz" HTTP::path $path } switch $path { "/abc" { pool pool_abc } "/xyz" { pool pool_xyz } } }
- gaza_104946NimbostratusThanks Aaron,
Recent Discussions
Related Content
DevCentral Quicklinks
* 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
Discover DevCentral Connects