Forum Discussion
Web Access By Replacing host
Okay, let's start with something simple and work from there. But first, I'd like to point out that the samples from your first post are different than your second. In the first post you indicated that the client would be using a shorter URI that started with "/Branch1" and that you'd need to rewrite that to a longer internal URI (/App1.web/vDir/Branch1). So this is how that version might look:
when HTTP_REQUEST {
switch -glob [string tolower [HTTP::uri]] {
"/branch1*" {
HTTP::header replace Host "Server1.CompanyInternalDomain.com:1034"
HTTP::uri "/App1.web/vDir/Branch1"
pool branch1_pool
}
"/branch2*" {
HTTP::header replace Host "Server2.CompanyInternalDomain.com:1035"
HTTP::uri "/App2.web/vDir/Branch2"
pool branch2_pool
}
"/branch3*" {
HTTP::header replace Host "Server3.CompanyInternalDomain.com:1036"
HTTP::uri "/App3.web/vDir/Branch3"
pool branch3_pool
}
}
In your second post, it appears the incoming URI is the same as internal URI, in which case you wouldn't have to do any URI translation. Here's what that might look like:
when HTTP_REQUEST {
switch -glob [string tolower [HTTP::uri]] {
"/app1.dev/vdir/branch1*" {
HTTP::header replace Host "Server1.CompanyInternalDomain.com:1034"
pool branch1_pool
}
"/app2.dev/vdir/branch2*" {
HTTP::header replace Host "Server2.CompanyInternalDomain.com:1035"
pool branch2_pool
}
"/app3.dev/vdir/branch3*" {
HTTP::header replace Host "Server3.CompanyInternalDomain.com:1036"
pool branch3_pool
}
}
In this case we're only evaluating the request URI and not changing it. In both cases you're changing the HTTP Host header and then sending the request to a specific pool. Again, the port number in the Host header suggests that the server is listening on this special port, so you either need to issue a node command to send the request to a specific node IP and port, or create separate pools for each application/port instance. It also doesn't appear that any back end service is using SSL, so you probably don't need a server SSL profile or the SSL::disable serverside command.
And last, if the first version is what you need (with URI translation), this should all work unless the server returns payload that contains references to the internal URI path. This may or may not be an issue, so no need to jump into troubleshooting steps just yet.
Not to mention that I was told that there's a bug in OS build 11.2.0 hot fix 7 and I am not really sure what to do about it, but I have a case open with F5 support for that.
Can you elaborate on this?
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
