Forum Discussion
PSPK
Nimbostratus
May 20, 2015Reverse Proxy Setup
Hi I have an external URL...www.foxrun.com
I have 3 pool members aa1:80, aa2:80 and aa3:80
I configured a VIP foxrun:80 with pool of those 3 members
Each pool member has an internal ...
cjunior
Nacreous
Jun 08, 2015Hi,
I made an example to do this trick based on the server IP address. To do it with node's name, I think you must create a data group with servers name as values and IP as key then check it in switch statement. You must associate a stream profile in the VS. Regards.when CLIENT_ACCEPTED {
ensures the server informations to the HTTP_REQUEST event.
LB::connect
}
when HTTP_REQUEST {
stores the current host header value
set request_host "[HTTP::header Host]"
checks the member by address:port
switch "[LB::server addr]:[LB::server port]" {
"10.10.10.1:80" {
set rewrite_host "aa1.foxrun.com"
}
"10.10.10.2:80" {
set rewrite_host "aa2.foxrun.com"
}
"10.10.10.3:80" {
set rewrite_host "aa3.foxrun.com"
}
default {
set rewrite_host ""
}
}
If found, change their request.
if { $rewrite_host ne "" } {
STREAM::disable
HTTP::header remove "Accept-Encoding"
HTTP::header replace "Host" $rewrite_host
}
}
when HTTP_RESPONSE {
if { [HTTP::header value "Content-Type"] contains "html" and $rewrite_host ne "" } {
replaces the content with the previous request host header
STREAM::expression "@$rewrite_host@$request_host@"
STREAM::enable
}
}
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