Forum Discussion
nitass
Nov 03, 2014Employee
this is just an example. it may not fully be what you are looking for but hope it helps.
configuration
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 { }
stream { }
tcp { }
}
rules {
qux
}
source 0.0.0.0/0
source-address-translation {
type automap
}
vs-index 3
}
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 {
STREAM::disable
HTTP::header remove "Accept-Encoding"
switch -glob -- [HTTP::uri] {
"/example1/*" {
HTTP::uri [string map {"/example1" ""} [HTTP::uri]]
HTTP::host "example1.domain.tld"
}
default {
do something
}
}
}
when HTTP_RESPONSE {
if { [HTTP::header value Content-Type] contains "text" } {
STREAM::expression {@http://example1.domain.tld@http://host.domain.tld/example1@@http://example2.domain.tld@http://host.domain.tld/example2@}
STREAM::enable
}
}
}
original response
[root@ve11a:Active:In Sync] config curl http://200.200.200.101/test.html
1:http://www.google.com
2:http://example1.domain.tld/something
3:http://example2.domain.tld/somethingelse
4:http://www.yahoo.com
trace
[root@ve11a:Active:In Sync] config ssldump -Aed -nni 0.0 port 80
New TCP connection 1: 172.28.24.1(38472) <-> 172.28.24.10(80)
1415022550.4740 (0.0014) C>S
---------------------------------------------------------------
GET /example1/test.html HTTP/1.1
User-Agent: curl/7.15.5 (i686-redhat-linux-gnu) libcurl/7.15.5 OpenSSL/0.9.8b zlib/1.2.3 libidn/0.6.5
Host: 172.28.24.10
Accept: */*
---------------------------------------------------------------
New TCP connection 2: 200.200.200.14(38472) <-> 200.200.200.101(80)
1415022550.4755 (0.0013) C>S
---------------------------------------------------------------
GET /test.html HTTP/1.1
User-Agent: curl/7.15.5 (i686-redhat-linux-gnu) libcurl/7.15.5 OpenSSL/0.9.8b zlib/1.2.3 libidn/0.6.5
Host: example1.domain.tld
Accept: */*
---------------------------------------------------------------
1415022550.4778 (0.0022) S>C
---------------------------------------------------------------
HTTP/1.1 200 OK
Date: Mon, 03 Nov 2014 13:34:43 GMT
Server: Apache/2.2.3 (CentOS)
Last-Modified: Mon, 03 Nov 2014 12:57:04 GMT
ETag: "418999-81-e21e2800"
Accept-Ranges: bytes
Content-Length: 129
Content-Type: text/html; charset=UTF-8
1:http://www.google.com
2:http://example1.domain.tld/something
3:http://example2.domain.tld/somethingelse
4:http://www.yahoo.com
---------------------------------------------------------------
1415022550.4781 (0.0041) S>C
---------------------------------------------------------------
HTTP/1.1 200 OK
Date: Mon, 03 Nov 2014 13:34:43 GMT
Server: Apache/2.2.3 (CentOS)
Last-Modified: Mon, 03 Nov 2014 12:57:04 GMT
ETag: "418999-81-e21e2800"
Accept-Ranges: bytes
Content-Type: text/html; charset=UTF-8
Transfer-Encoding: chunked
8b
1:http://www.google.com
2:http://host.domain.tld/example1/something
3:http://host.domain.tld/example2/somethingelse
4:http://www.yahoo.com
---------------------------------------------------------------