Try the following approach, ensuring proper handling of both the path replacement and subfolder routing:
when HTTP_REQUEST {
# Log the original URI for debugging
log local0. "Original URI: [HTTP::uri]"
# Check if the URI starts with "/admin"
if {[HTTP::path] starts_with "/admin"} {
# Replace only the initial "/admin" with "/"
set new_path [string map {"/admin" "/"} [HTTP::path]]
set new_uri "${new_path}[HTTP::query]"
# Update the URI to reflect the modified path
HTTP::uri $new_uri
# Log the modified URI for debugging
log local0. "Modified URI: [HTTP::uri]"
# Forward the request to POOL-A
pool POOL-A
} else {
# Log default traffic for debugging
log local0. "Default traffic - URI: [HTTP::uri], Pool: POOL-B"
# Forward to the default pool
pool POOL-B
}
}
Fintech Companies