Jose_Santiago_O
Apr 24, 2008Nimbostratus
Rewriting 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.