Forum Discussion
jgrohol_43248
Nimbostratus
Jun 28, 2010Port Translation
I've been struggling all day with this one... I have two separate problems and not sure if they are related.
1. I have a VS configured to listen on an IP and on port HTTP 80. I have it attached to a pool with a few webservers in it. The webservers are serving on port TCP 8080 instead. I have the "Port Translation" checkbox checked under the VS settings. It appears that it is not working.
2. The URL that points to that VIP is "http://test1.phly.net". When you hit that URL and it gets passed along to the pool member, the server replies with an HTTP 301 redirect and replies with its own hostname instead "http://server1.phly.net". We want to find when a 301 redirect comes in and replace the hostname with the original URL of "http://test1.phly.net". I've been working with iRules but couldn't really get anything working as of yet. One of the problems in the iRule is that we don't want to statically set what to swap out in the HTTP Header. This needs to be dynamic because of all of the possible pool members that it can have.
Any ideas or suggestions?
I'm on version 10.1.0.
14 Replies
Sort By
- Michael_Yates
Nimbostratus
I agree with Hoolio in his suggestion of using something like Fiddler 2 (http://www.fiddlertool.com/fiddler/version.asp), it is the only Web Debugging tool that I know of that supports debugging HTTPS traffic. - jgrohol_43248
Nimbostratus
Yes I grabbed Fiddler to help me see what was going on. On a separate situation, is there a way to create this same type of iRule but instead of looking into the HTTP header for the URI, can you look in the HTML body and replace the URI's there? - hoolio
Cirrostratus
The most efficient way to replace payload content is a blank stream profile and a STREAM::expression based iRule. See the wiki page for examples: - Michael_Yates
Nimbostratus
You can replace anything in the Header if you know specifically what your looking for and want to replace it with.when HTTP_RESPONSE { if { [HTTP::is_redirect] } { HTTP::header replace Location [ string map {"server1" "test1"} [HTTP::header Location] ] } }
when HTTP_RESPONSE { Check if response is a redirect if {[HTTP::is_redirect]}{ HTTP::header replace Location [string map -nocase "[URI::path [HTTP::header Location]] /some/value/index.html" [HTTP::header Location]] } }
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