iRule to Shift Entire URL Path to Lower Case
I have the following iRule in place for one of our virtual servers. Everything is working well, except some requests to the backend servers are case sensitive and need the entire path to be lowercase. For example:
https://dev.test.com/cdn/img/Test.png ---> https://dev.test.com/cdn/img/test.png
How can I achieve this with the existing iRule I have below? Thanks!
when CLIENT_ACCEPTED {
SSL::disable serverside
}
when HTTP_REQUEST {
if { not ( [HTTP::path] ends_with "/") && not (
[URI::basename [HTTP::uri]] contains "." ) } {
# Append slash and keep querystring when it exists
HTTP::respond 301 Location https://[HTTP::host][HTTP::uri]/[expr { "[URI::query [HTTP::uri]]"
eq {} ? {} : "?[URI::query [HTTP::uri]]" }]
}
if { [string tolower [HTTP::uri]] starts_with "/apps" } {
pool ProxyPass_DEV_pool_2
}
elseif { [string tolower [HTTP::uri]] starts_with "/proxy" } {
pool ProxyPass_DEV_pool_2
}
elseif { [string tolower [HTTP::uri]] starts_with "/arcgisserver" } {
pool ProxyPass_DEV_pool_3
}
elseif { [string tolower [HTTP::uri]] starts_with "/aspnet" } {
pool ProxyPass_DEV_pool_3
}
elseif { [string tolower [HTTP::uri]] starts_with "/api/search" } {
SSL::enable serverside
pool ProxyPass_DEV_pool_4
}
elseif { [string tolower [HTTP::uri]] starts_with "/cdn" } {
HTTP::host docdevvm.test.com
pool ProxyPass_DEV_pool_1
}
else {
pool ProxyPass_DEV_pool_1
}
}