Forum Discussion
Stanislas_Piro2
Oct 05, 2015Cumulonimbus
Hi,
If you want to allow /test1, you can redirect / to /test1/ instead of rewriting path.
- if you rewrite path and the content of the response contains links like img/logo.php, the browser will request /img/logo.php.
- if you redirect to /test1/ and the content of the response contains links like img/logo.php, the browser will request /test1/img/logo.php
You can also store the virtual server default pool in a variable to use it in the "default" statement.
when CLIENT_ACCEPTED {
set default_pool [LB::server pool]
}
when HTTP_REQUEST {
switch [string tolower [HTTP::path]] {
"/" {
HTTP::redirect /
}
"/test1" -
"/test1/" {
pool pool-1111
}
"/test2" -
"/test2/" {
pool pool-2222
} default {
pool $default_pool
}
}
}