Hi!
Maybe this is not the answer you're looking for, in which case we can adjust it a bit.
A few suggestions:
- Try to avoid the -sub switch if you can as it demotes the LB to a use single core processing.
- Use the is_redirect check to avoid using costly regsub commands in vain.
A rule suggestion (providing that you will always replace the location with the same url):
when HTTP_RESPONSE {
Ferret out bad location headers
if { [HTTP::is_redirect] } {
set location [string tolower [HTTP::header values Location]]
if { $location contains "test" || $location contains "a401" } {
log local0. "Header before: [HTTP::header values Location]"
HTTP::header replace Location "dtl.somedomain.com"
log local0. "Header after: [HTTP::header values Location]"
}
}
}
/Patrik