Forum Discussion
Bryce_Halkerst1
Nimbostratus
Feb 19, 2015HTTP Class not supported on 11.4 and above
All,
Is there a tool to convert http classes to a local traffic policy? I have a support ticket opened with F5, however they are recommending removing all the http class profiles, then upgrading fro...
StephanManthey
Nacreous
Feb 24, 2015Hi Bryce,
for testing you can go with this one:
when HTTP_REQUEST {
switch -regexp [string tolower [HTTP::path]] {
{\.gif$} { log local0. "[HTTP::path] matches <\.gif$>" }
{\.pdf$} { log local0. "[HTTP::path] matches <\.pdf$>" }
{\.txt$} { log local0. "[HTTP::path] matches <\.txt$>" }
{\.css$} { log local0. "[HTTP::path] matches <\.css$>" }
{\.swf$} { log local0. "[HTTP::path] matches <\.swf$" }
{\.flv$} { log local0. "[HTTP::path] matches <\.flv$>" }
{\.png$} { log local0. "[HTTP::path] matches <\.png$>" }
{\.ico$} { log local0. "[HTTP::path] matches <\.ico$>" }
{\.js$} { log local0. "[HTTP::path] matches <\.js$>" }
{\.js[^p]+.*$} { log local0. "[HTTP::path] matches <\.js[^p]+.*$>" }
{\.jpg$} { log local0. "[HTTP::path] matches <\.jpg$>" }
{\.ogv$} { log local0. "[HTTP::path] matches <\.ogv$>" }
{\.ttf.*$} { log local0. "[HTTP::path] matches <\.ttf.*$>" }
{\.mpv$} { log local0. "[HTTP::path] matches <\.mpv$>" }
{\.webm$} { log local0. "[HTTP::path] matches <\.webm$>" }
{\.*.m4v$} { log local0. "[HTTP::path] matches <\.*.m4v$>" }
{\.mp4$} { log local0. "[HTTP::path] matches <\.mp4$>" }
{\.xml$} { log local0. "[HTTP::path] matches <\.xml$>" }
default { log local0. "<[HTTP::path]> no match; using default pool" }
}
HTTP::respond 200 content "okay" Connection close
}
Due to the string tolower we can reduce the number of comparisons.
Maybe your app is working with the following one:
when HTTP_REQUEST {
switch -regexp [string tolower [HTTP::path]] {
{\.gif$} -
{\.pdf$} -
{\.txt$} -
{\.css$} -
{\.swf} -
{\.flv$} -
{\.png$} -
{\.ico$} -
{\.js$} -
{\.js[^p]+.*$} -
{\.jpg$} -
{\.ogv$} -
{\.ttf.*$} -
{\.mpv$} -
{\.webm$} -
{\.*.m4v$} -
{\.mp4$} -
{\.xml$} { pool preview_static_lb }
default { log local0. "<[HTTP::path]> no match; using default pool" }
}
}
I´m struggling with an expression '(?i)^(?!.*.jsp)..html?.$' from your httpclass.
It´s case insensitive with a negativ lookahead to match everything not containing ".jsp" and ending with "htm" or "html" followed by some single character, if I got it right.
Thanks, Stephan
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)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