Forum Discussion
Stanislas_Piro2
Mar 12, 2019Cumulonimbus
Hi,
when you write an irule which change pool, never forget to define a default statement, even if the virtual server already assigned a default pool...
pool selection is connection based, except if there is oneconnect profile assigned to virtual server, which is false on the vs configuration.
this means that the following URI will have this behavior with your irule:
- URI / --> pool XXXXX_Pool
- URI /abc/foo/bar --> pool generic_pool
- URI / --> pool generic_pool (because the previous request changed the pool assigned to the connection)
try this code:
when CLIENT_ACCEPTED {
set default_pool [LB::server pool]
}
when HTTP_REQUEST {
switch -glob [string tolower [HTTP::path]] {
"/abc*" { pool generic_pool
HTTP::path "/abc-test"
}
"/def*" { pool generic_pool
HTTP::path "/def-test"
}
"/ghi*" { pool generic_pool
HTTP::path "/ghi-test"
}
default { pool $default_pool
}
}
}
if the server respond with absolute URL including port number, the client will request to pool member's port...