Forum Discussion
Dave_Noonan
Cirrus
Feb 17, 2020Persistence for selected URIs on a VS
Looking for suggestions on the best way to accomplish this. We want specific URIs to have cookie persistence enabled while the persistence on the virtual server is None. I'm pretty sure t...
Dave_Noonan
Cirrus
Feb 18, 2020Your code looks a lot like what I came up with after further searching, so that's reassuring.
when HTTP_REQUEST {
switch -glob [string tolower [HTTP::path]] {
"/blahblah/app/*" -
"/blahblah/api/*" {
# If client is public IP then send 404
if { not ([class match [IP::client_addr] equals private_net]) } {
HTTP::respond 404 content "HTTP ERROR 404 Reason:Not Found" Mime-Type "text/html"
event disable
TCP::close
} else {
# If client is private IP set cookie persistence
persist cookie insert blahblah_Cookie 0
}
}
}
}The second question is just to block those from non-RFC1918 IP space. I included that in my irule but feel free to tell me if there's a better way.
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
