Rewriting HTTP responsesSuppose that you wanted to publish an internal website (http://intranet.mycorp.com/) so that it can be accessed externally (with the correct access controls and security of course!). However, the domain name One key requirement is to rewrite any HTML that includes references to
Here's a briefer version that works with current versions of Zeus Traffic Manager:
Comments:This public messageboard is not a forum for technical support. To report technical support problems, please contact our dedicated Support team using the instructions at the bottom of this page.
Comment from:
Steven Bibby [Visitor]
As per the TrafficScript reference, the result of the http.getResponseHeader( "Content-Type" ) function could be something like 'text/html; charset=ISO-8859-1'. If this is the case, then this example will break and not run the string.regexsub.
Do you have an alternative that takes this into account?
Comment from:
Owen Garrett [Zeus Dev Team]
Good point... try using string.startsWith() as follows:
$ct = http.getResponseHeader( "Content-Type" ); if( !string.startsWith( $ct, "text/html" ) ) break;or, for more brevity: if( !string.startsWith( http.getResponseHeader( "Content-Type" ), "text/html" ) )
break;
Comment from:
Adam Daughterson [Visitor]
This is great for TrafficScript, but I'm not finding any way to do this with RuleBuilder and ZXTM complains that TrafficScript rules cannot be run under my current license. Any help?
Thanks in advance, AD
Comment from:
Owen Garrett [Zeus Dev Team]
This type of capability is only available via TrafficScript, not RuleBuilder. You may have a ZXTM LB license (which just permits RuleBuilder), rather than a full ZXTM license.
Comment from:
Jenny Martin [Visitor]
I have been using this code happily for some time, but now it is crashing zxtm trying to handle a giant 2GB response body as one string. Any chance of a chunked version?
Comment from:
Owen Garrett [Zeus Dev Team]
Hi Jenny - take a look at the http response streaming functions we added in the Zeus Traffic Manager 6.0 release. These http.stream.* functions let you read responses in manageable chunks and modify them without having to read the entire response in in one go. There are examples in the TrafficScript manual.
Comment from:
Jonathan Garratt [Visitor]
So is there any way of achieving this if you only have the ZXTM LB license please?
Comment from:
Owen Garrett [Zeus Dev Team]
Hi Jonathan,
Zeus LB does not have TrafficScript; it just provides the simpler RuleBuilder interface. Rulebuilder does not have the capabilites to modify HTTP responses in the way described in this article. You may be able to use the Change Site or HTTP Redirect actions to intercept incoming requests and redirect or rewrite them; in the example above, you would need to ensure that externally, the domain intranet.mycorp.com resolves to an appropriate IP that is handled by the load balancer. |
Recently...
Other Resources
|





