Forum Discussion
How do I route traffic to a specific directory on a node?
I have a couple of nodes that serve webpages on:
I can connect directly to the server using, and the page displays fine. However, if I use http://server1:9080, I get an error - the virtual directory hasn't been created.
I tried using an irule to rewrite the url sent to the node:
when HTTP_REQUEST_RELEASE { HTTP::header replace Host "[LB::server addr]:9080/website" }
The irule partially worked and sent traffic to http://server1%12:9080 (the F5 has 2 route domains) but didn't add /website after the port number.
Is there another way to get to a specific directory on a node?
3 Replies
- mimlo_61970
Cumulonimbus
The path(directory) is not in the Host header, only the hostname and optional port are. You need to modify the HTTP::uri instead. The forums are full of examples on rewriting the URI.
- Scott_S_160682
Nimbostratus
mimlo, thanks for your response, i'm able to rewrite the uri using
when HTTP_REQUEST_RELEASE { HTTP::header replace Host "[LB::server addr]" HTTP::path "/website" }
but since we use route domains the uri is http://server1%12:9080/website
how do i get rid of the %12 route domain
- nitass
Employee
how do i get rid of the %12 route domain
you can use scan command.
e.g.
% set ip 1.2.3.4%12 1.2.3.4%12 % scan $ip {%[^%]} iponly 1 % put $iponly 1.2.3.4
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)Recent Discussions
Related Content
* 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