Forum Discussion
Parveez_70209
Nimbostratus
Aug 27, 2013Assist in Writing the below script with using Data Group String Class
when CLIENT_ACCEPTED { set default_pool [LB::server pool] log local0. "Default pool [LB::server pool] set" log local0. "Client IP is [IP::remote_addr]" }
when HTTP_REQUEST { set http_uri [string to...
Kevin_Stewart
Employee
Aug 27, 2013Perhaps something like this:
when CLIENT_ACCEPTED {
set default_pool [LB::server pool]
log local0. "Default pool [LB::server pool] set"
log local0. "Client IP is [IP::remote_addr]"
}
when HTTP_REQUEST {
set http_uri [string tolower [HTTP::uri]]
log local0. "requested [HTTP::uri]"
if {$http_uri equals "/" } {
HTTP::redirect "https://apbuild.leni2.com/SEUILibrary/controller/e/web/LenovoPortal/en_US/catalog.workflow:test-home"
pool pool_confarmct.leni2.com_http
log local0. "redirected from /"
return
} elseif { $http_uri starts_with "/iss_static" } {
log local0. "matched /iss_static"
pool pool_confarmct.leni2.com_http
log local0. "pool_confarmct.leni2.com_http defined, [LB::server pool] selected"
return
} elseif { [class match [string tolower [HTTP::path]] ends_with my_file_ending_dg] } {
pool pool_confarmct.leni2.com_http
log local0. "[class match -name [string tolower [HTTP::path]] ends_with my_file_ending_dg] - object $http_uri pool_confarmct.leni2.com_http defined [LB::server pool] selected"
} else {
log local0. "no match for rev. close connection"
HTTP::close
}
}
Where "my_file_ending_dg" is a string-based data group. Example:
".css" := ""
".doc" := ""
".txt" := ""
".svg" := ""
".avi" := ""
...
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