Hans_Schneider2
Jul 10, 2007Nimbostratus
Rewriting /aaa to /bbb and assigning pool transparently
Hi All,
I have a virtual server set up that I wish to add an irule for.
Basically the start of the uri will be used to choose the actual context on the actual servers in the pools.
I.e. in pseudo code, which I have been trying multiple variations of:
when HTTP_REQUEST {
if { [HTTP::uri] starts_with "/aaa" } {
HTTP::uri replace "/aaa" "/111"
pool 111_pool
}
elseif { [HTTP::uri] starts_with "bbb" } {
HTTP::uri replace "/bbb" "/222"
pool 222_pool
}
elseif { [HTTP::uri] starts_with "ccc" } {
HTTP::uri replace "/ccc" "/333"
pool 333_pool
}
else {
This is just here to catch the rest
HTTP::redirect "https://[HTTP::host]/aaa[HTTP::uri]"
}
}
So that the LTMs will send the request to one of the servers in the pools (they're set up fine btw) for example http://10.10.10.10/111/blah.html where /111 is set up on apache as a context.
Is it possible also so that I could do something for the returning traffic so that the end user doesn't notice the uri translation?
Thank you for your patience, and time.
Best regards,