Forum Discussion
pjcampbell_7243
Mar 17, 2011Cirrus
jsp request making it to image pool
Every once in a while a jsp request is making it to our image pool. I have never seen this before. we have been using the following iRule for a few years. We just setup another website using the same iRule.
Here is the irule:
when CLIENT_ACCEPTED {
Save default pool name
set default_pool [LB::server pool]
}
when HTTP_REQUEST {
if { [HTTP::path] ends_with ".jpg" }{
pool images.xxx.com
} elseif { [HTTP::path] ends_with ".gif" }{
pool images.xxx.com
} elseif { [HTTP::path] ends_with ".png" }{
pool images.xxx.com
}
}
Would the following fix the problem (see "else"):
when CLIENT_ACCEPTED {
Save default pool name
set default_pool [LB::server pool]
}
when HTTP_REQUEST {
if { [HTTP::path] ends_with ".jpg" }{
pool images.xxx.com
} elseif { [HTTP::path] ends_with ".gif" }{
pool images.xxx.com
} elseif { [HTTP::path] ends_with ".png" }{
pool images.xxx.com
} else {
pool $default_pool
}
}
one thing to mention is that we have multiple websites with different pools using the same iRule so, we need to make sure we don't accidently send requests for one site to another site.
BTW, sounds like I could make this a bit more efficient with the following? (what is switch -glob vs regular old switch?)
when CLIENT_ACCEPTED {
Save default pool name
set default_pool [LB::server pool]
}
when HTTP_REQUEST {
switch -glob [HTTP::path] {
*.png { pool images.xxx.com }
*.jpg { pool images.xxx.com }
*.gif { pool images.xxx.com }
default { pool $default_pool }
}
}
- The_BhattmanNimbostratusHi pjcampbell,
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