Forum Discussion
paul_dcc
Nimbostratus
Sep 05, 2014Redirect
Hi All,
I need to do a redirect to a server, which is ok;
when HTTP_REQUEST {
if { [HTTP::host] equals "apps.dev.geowessex.com" and [HTTP::uri] contains "/explorer" } {
log local0. "Redirec...
nitass
Employee
Sep 05, 2014can you try something like this?
e.g.
config
root@(ve11a)(cfg-sync In Sync)(Active)(/Common)(tmos) list ltm virtual bar
ltm virtual bar {
destination 172.28.24.10:80
ip-protocol tcp
mask 255.255.255.255
pool foo
profiles {
http { }
tcp { }
}
rules {
qux
}
source 0.0.0.0/0
source-address-translation {
type automap
}
vs-index 7
}
root@(ve11a)(cfg-sync In Sync)(Active)(/Common)(tmos) list ltm pool foo
ltm pool foo {
members {
200.200.200.101:80 {
address 200.200.200.101
}
}
}
root@(ve11a)(cfg-sync In Sync)(Active)(/Common)(tmos) list ltm rule qux
ltm rule qux {
when HTTP_REQUEST {
if { [HTTP::host] equals "apps.dev.geowessex.com" and [HTTP::path] starts_with "/explorer" } {
HTTP::header replace Host "explorer.dev.geowessex.com"
HTTP::uri [string map {"/explorer" ""} [HTTP::uri]]
node 200.200.200.111
}
}
}
trace
[root@ve11a:Active:In Sync] config ssldump -Aed -nni 0.0 port 80
New TCP connection 1: 100.100.100.28(39498) <-> 172.28.24.10(80)
1409906668.3057 (0.0049) C>S
---------------------------------------------------------------
GET /explorer/something HTTP/1.1
User-Agent: curl/7.19.7 (x86_64-redhat-linux-gnu) libcurl/7.19.7 OpenSSL/1.0.1h zlib/1.2.3 libidn/0.6.5
Accept: */*
Host: apps.dev.geowessex.com
---------------------------------------------------------------
New TCP connection 2: 200.200.200.14(39498) <-> 200.200.200.111(80)
1409906668.4753 (0.1675) C>S
---------------------------------------------------------------
GET /something HTTP/1.1
User-Agent: curl/7.19.7 (x86_64-redhat-linux-gnu) libcurl/7.19.7 OpenSSL/1.0.1h zlib/1.2.3 libidn/0.6.5
Accept: */*
Host: explorer.dev.geowessex.com
---------------------------------------------------------------
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