Forum Discussion
Pedro_Minas
Nimbostratus
Jul 06, 2010Reverse Proxy Problems
Hello
I'm trying to create a reverse proxy in my F5 BIG-IP. I'm having problems with the redirection to another port.
What i'm doing is this...
the user connects to a VS ...
Michael_Yates
Nimbostratus
Jul 07, 2010Try this:
when HTTP_REQUEST {
if { [string tolower [HTTP::uri]] starts_with "/xpro.xx.tt" } {
HTTP::uri xpro.xx.tt/teste/tt/rr
pool teste-reverse_proxy-pool1
}
}
Note: This code will NOT change the URL in the browser. It will only change the URL Request being sent to the server, and then sends that newly formed request to the specified pool.
If you want the Browser URL to change you will have to add additional logic:
when HTTP_REQUEST {
if { [string tolower [HTTP::uri]] equals "/xpro.xx.tt" } {
HTTP::redirect http://[getfield [HTTP::host] ":" 1]/xpro.xx.tt/teste/tt/rr
}
}
The code above assumes that the pool "teste-reverse_proxy-pool1" is the default pool assigned to the Virtual Server. If not:
when HTTP_REQUEST {
if { [string tolower [HTTP::uri]] equals "/xpro.xx.tt" } {
HTTP::redirect http://[getfield [HTTP::host] ":" 1]/xpro.xx.tt/teste/tt/rr
}
if { [string tolower [HTTP::uri]] starts_with "/xpro.xx.tt/teste/tt/rr" } {
pool teste-reverse_proxy-pool1
}
}
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