Forum Discussion
ABHAY_101908
Nimbostratus
Nov 03, 2009ProxyPass Irule --- reverse proxy
Dear all:
I am trying to replace my existing reverse proxy functionality from my apache to BIG-IP LTM.
Can any one help me out how to add the config in the proxypass v10 ir...
hoolio
Cirrostratus
Nov 17, 2011Can you explain what you want to happen with non-/directory/ requests? Do you want them to go to the same server(s) as /directory/ requests? Or separate server(s)? Do you know if the host header needs to be rewritten?
Here's a guess at what you mean. This assumes you want /directory/ requests sent to one set of server(s) and non-/directory/ requests to go to the virtual server's default pool. I'm also rewriting the URI from /directory/ to /new-directory/ and updating the host header value to the server IP and port.
when CLIENT_ACCEPTED {
Save the name of the VS default pool
set default_pool [LB::server pool]
}
when HTTP_REQUEST {
Check the requested URI
switch -glob [HTTP::uri] {
"/directory/*" {
Select a custom pool for these requests
pool directory_pool
Replace /directory/ with /new-directory/ in the URI
HTTP::uri [string map {/directory/ /new-directory/} [HTTP::uri]]
Track that we will replace the Host header on these requests
set rewrite_host 1
}
default {
pool $default_pool
set rewrite_host 0
}
}
}
when HTTP_REQUEST_SEND {
Rewrite the host header to the selected server IP:port
if {$rewrite_host}{
clientside {
HTTP::header replace Host "[IP::server_addr]:[TCP::server_port]"
}
}
}
Aaron
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