Forum Discussion
TJ_Vreugdenhil
Aug 17, 2011Cirrus
Persistance iRule
VIP = 10.7.200.21
URL = http://alerts.company.edu/
URI needs to have persistence = http://alerts.company.edu/client/*
URI no persistence = http://alerts.company.edu/csi/* ...
The_Bhattman
Aug 17, 2011Nimbostratus
Posted By work_hard_play_hard on 08/17/2011 12:12 PM
I used the default cookie persistence profile (insert mode) and applied the iRule you suggested. I believe persistence is working correctly, but the website reports a redirect loop:alerts.company.edu/client and then send it over to the alternative pool. It will do a redirect if it's "http://alerts.company.edu/client/something" or "http://alerts.company.edu/client/something/something" , etc. If you use HTTP::path you are basically only seeing the path and not any query strings
For example
the following URL:The path is:Note that only ? is used as the separator for the query string. So, for the following URL:the path is:
As you can see HTTP::path doesn't contain query string which is not the entire URL.
If I update the iRule to use HTTP:path and remove the trailing '/' - Will that prevent it from looping, or do I have to use an " & amp & " operators with a string? Any helpful debug log statements are appreciated. Still learning 🙂
when HTTP_REQUEST {
log local0.debug "using persistence"
switch -glob [string tolower [HTTP::path]] {
"/client" { pool athoc_pool_1 }
default {
persist none
HTTP::redirect "http://[HTTP::host]/csi"
log local0.debug "using redirect"
}
}
}
-TJ If you remove the "/" in the manner you suggested the iRULE condition statement will match exactly http://
1 http://www.example.com:8080/main/in...ogin=check
1 /main/index.jsp
1 http://www.example.com:8080/main/in...ogin=check
1 /main/index.jsp;session_id=abcdefgh
So if you are okay with that you can proceed to use it. However, i would further investigate whether the loop is explicitly being caused by the webserver or the iRULE itself.
I hope this helps
Bhattman
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