Hi all and Happy New Year!
I have been struggling wth an issue regarding streams and changing text.
For disaster recovery testing, I have a set of virtual hosts that are EXACT copies of my production system. So, if the web server on a host responds to myhost.company.com to route the request to the virtual hosted instance, even in DR, I still need to set the HOST header to myhost.company.com even though it is a different IP address (the production site is still running as the real IP address). I made this work a long time ago by adding entries in the DNS such as myhost-dr.company.com and having that route to the DR site. In an iRule, if I see the -DR at the end of the first node of the hostname, I strip that off and change the host header back to the myhost.company.com. That works just fine INBOUND.
The only time it causes an issue is if the website asserts the original name in a URL it sends. As long as the site uses relative links, we are fine. The URL of the browser stays myhost-dr.company.com. I have found some servers (the JBOSS ones in particular) are sending out absolute links with myhost.company.com. When the browser gets this, it natually redirects this over to the myhost.company.com site which is production! So, the user that was testing a DR site is now accidentlly testing a production site--bad news!
I have tried with limited success to use a STREAM profile to look for any host name (company.com) and check to see if the server has a -dr at the end. If not, I change it to add -dr to the hostname. That works for items in the payload, but not in the headers. Does a STREAM profile act on the headers? I know I can simply iterate through the headers looking for company.com and check the name, but is that all? I assume this would handle the issue, but are there any other places a string can sneak by the STREAM profile or the headers? I cannot think of any but I htought I would check with the group on the scope of the STREAM profile regarding HTTP headers.
PS BTW, it has never been clear to me if I can use a STREAM profile to add text (changing myhost to myhost-dr. I have read things int he documentation that make me question if the content-length will be correct. Thoughts? I presume a STREAM HAS to allow one to change th elength of the output or it would be of very limited use.
Thanks,
Tom Schaefer