Forum Discussion
Mohammad_1363
Altocumulus
Jul 15, 2021Redirect HTTP along with header
Hello I am trying to redirect HTTP request from one service to another URL like below when HTTP_REQUEST { if { [string tolower [HTTP::host]] equals "service-api.xx.com" } { HTTP::redirec...
spalande
Nacreous
Jul 15, 2021You can try below
when HTTP_REQUEST {
switch -glob [string tolower [HTTP::host]] {
"service-api.xx.com"
{
if { [HTTP::header exists "Auth_header"] } {
set token [HTTP::header value Auth_header]
HTTP::respond 301 Location https://newservice.api.xx.com/test-cg[HTTP::uri]" "Auth_header" "$token"
return
}
} default {
return
}
}
}
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