Forum Discussion
spalande
Aug 27, 2021Nacreous
You can try below code
when HTTP_REQUEST {
if { [string tolower [HTTP::host]] equals "api.example.com" } {
HTTP::header replace "Host" "api.newexample.com"
pool api-newexample-com
return
}
switch -glob [string tolower [HTTP::uri]] {
"/path1/example*" -
"/path2/example*"
{
pool pool-example
}
"/version2/sport1*"
{
if { [HTTP::method] eq "POST"} {
pool sport_pool
} else {
reject
}
} default {
return
}
}
}