Forum Discussion
LyonsG_85618
Dec 06, 2012Cirrostratus
IRULE to block URI after a specific date
I have been asked to create VIP to route traffic through to a test web server.
What the customer want is a test URI that has an expiry date. The date will then be verified aganist the current da...
LyonsG_85618
Jan 21, 2013Cirrostratus
I have managed to get the date check working and now 'expired' hosts get sent to a notfound page:
when HTTP_REQUEST {
set debug 1
set datecheck CLASS_DATE_CHECK
set today [clock format [clock seconds] -format {%Y%m%d} ]
set expiry_date [class match -value [string tolower [HTTP::uri]] starts_with $datecheck]
set uriexpired 0
if {($expiry_date < $today)} {
set uriexpired 1
}
if {($uriexpired equals "1") and ([HTTP::uri] equals [class match -name [string tolower [HTTP::uri]] starts_with $datecheck])} {
if {$debug > 0} {
log local0. "uri=[HTTP::uri] and Classmatch=[class match -name [string tolower [HTTP::uri]] starts_with $datecheck]"
}
HTTP::respond 302 noserver Location "http://www.test.com/notfound"
Still looking at the URI part though. My customer wants to publish a random string before the actual 'real' uri.
i.e. http://www.test.com/123456789/testsite1
I need to remove the /123456789 before passing to pool and then add it back in before responding to clients.
As the string will be randomly generated I cannot use a string replace.
I was looking at stream profile's too but not sure which option would work best?
Any thoughts?
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