Forum Discussion
Jose_Santiago_O
Nimbostratus
Apr 24, 2008Rewriting external host
Hi,
I want to do this with rules: if an external client goes to http://www.externalserver.com/abc/app1, make this client go to http://internalserver1/app1 without redirecting, because http://internalserver1 is not reachable outside the company, if another client goes to http://externalserver.com/def/app1, then make this client goes to http://internalserver2/app1, also without redirecting since internalserver2 is not reachable outside the company.
I can do the uri rewriting with string range, the problem is that the browser is redirecting the host to my internal server and outside the company it wont work.
So far, i have this:
when HTTP_REQUEST {
if { [string tolower [HTTP::uri]] starts_with "/abc" } {
HTTP::header replace Host internalserver1
set uri [string range [HTTP::uri] 4 end]
HTTP::uri $uri
pool pool_internalserver1
}
}
The web server are IIS and they need to match the hostname, so i need to send them the hostname, but without redirecting the browser to my final client.
Does anyone has done this before?
Regards,
Jose Santiago Oyervides.
- Colin_Walker_12Historic F5 AccountIf you need to re-write the hostname for the internal server, you'll want to look at the HTTP::header replace command. You'll also want to re-write it again on the way out for the client, since you don't want the client to see the change.
- hoolio
Cirrostratus
Kirk's ProxyPass rule seems like it would be a good solution for this as well:
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