Forum Discussion
Fonda_116704
Nimbostratus
May 13, 2014Redirect virtual server to complete url
Dear all..
I have one virtual server with 3 physical servers. Where the physical server using port 7777 (OAS). This one virtual server using port 80 to directing to port 7777. I've done with by...
Kevin_Stewart
Employee
May 13, 2014You wouldn't want to redirect to www.abc.com:7777, because that would cause the browser to try to open the connection on port 7777, and your VIP is only listening on port 80. At most you'd want to add the port to the Host header on its way through the proxy, but that's rarely necessary. The pool itself should be defined with the services listening on port 7777.
when HTTP_REQUEST {
if { [HTTP::uri] equals "/" } {
HTTP::redirect "http://[HTTP::host]/blah/blah/blah"
} else {
HTTP::header replace Host "www.abc.com:7777"
}
}
If the URI is empty (/), then redirect to /blah/blah/blah. Otherwise replace the incoming Host header (as required).
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)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