Forum Discussion
almudena_3796
Nimbostratus
Sep 11, 2013LTM VE 10.2.3: HTTP::uri
Hi everyone, My BIG-IP LTM VE has 10.2.3 version. I have created an irule, and a part of the code is:
switch -glob [HTTP::uri] { "/cm/" { set SELECTED_POOL "LPAGE_ALERTAS"
} "/delivery/im...
Kevin_Stewart
Employee
Sep 16, 2013If I may add, the HTTP::uri write command, on most platforms, does not actually rewrite the client request URI in session state - it only changes the value on the outgoing payload. Your iRule is definitely changing the URI on its way to the server, you just won't see that change in [HTTP::uri].
Also not completely sure what you were doing with the SELECTED_POOL variable, so here's a minor rewrite:
when CLIENT_ACCEPTED {
set default_pool to pool assigned to the virtual server
set default_pool [LB::server pool]
}
when HTTP_REQUEST {
set DEBUG 1
switch -glob [string tolower [HTTP::uri]] {
"/cm/*" {
pool "LPAGE_ALERTAS"
}
"/delivery/wifi*" {
set newuri [findstr [string tolower [HTTP::uri]] "/delivery" 9]
HTTP::uri $newuri
if { $DEBUG } { log local1. "LPAGE_APPLICATION URI MODIF:: $newuri - [HTTP::uri]" }
pool $default_pool
}
"/delivery*" {
pool $default_pool
}
default {
if { $DEBUG } { log local1. "LPAGE_APPLICATION :: blocked request for [HTTP::uri] by [IP::client_addr]" }
HTTP::respond 403
}
}
}
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