Forum Discussion
Bob_H__117248
Nimbostratus
Jun 06, 2013Reverse proxy redirection
I've tried using a Stream profile and iRule to redirect incoming external traffic to an internal server based upon the URI with no success.But the fact is I have no experience with using the stream p...
Kevin_Stewart
Employee
Jun 10, 2013Depending on the complexity of some applications, the ProxyPass iRule can be a necessary evil. It does the job of rewriting the incoming AND outgoing payloads, including URIs and Host headers. Thankfully the iRule is fairly well documented so it's not that difficult to set up.
1. Create the iRule - copy it from the website and modify the two values in the RULE_INIT event to enable (temporary) logging.
2. Create a data group called "ProxyPass". So for example, if the virtual server is called "my_vs", the data group would be called "ProxyPassmy_vs".
3. Create a series of entries that translate clientside requests to server side requests.
ex.
"/clientdir" := "/serverdir"
"www.host.com/clientdir" := "internal.company.com/serverdir"
"www.host.com/" := "internal.company.com/serverdir/"
"/abc123/" := "/xyz987/"
** for you application you probably just need to work with URIs.
It may take a little work to get this part just right depending on your application, but the logging will guide you.
Like I said, ProxyPass is designed to deal with complex applications. In the event, however, that your website doesn't require all of this, a simpler iRule to just catch the incoming URI and change it would look something like this:
when HTTP_REQUEST {
if { [string tolower [HTTP::uri]] starts_with "/abc123/test/test.htm" } {
HTTP::uri "/xzy987/"
}
}
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)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