Forum Discussion
zipperbox_11405
Nimbostratus
Jan 14, 2013Mulitple URL Replace and stream profile
I have a case where the internal naming of multiple servers have to be replaced by a single FQDN. I am succesful when dealing with one instance but not with many. Here is my current iRule, note: it s...
nitass
Employee
Jan 15, 2013e.g.
[root@ve10:Active] config b virtual bar80 list
virtual bar80 {
snat automap
pool foo
destination 172.28.19.252:80
ip protocol 6
rules myrule
profiles {
http {}
tcp {}
}
}
[root@ve10:Active] config b pool foo list
pool foo {
members 200.200.200.101:80 {}
}
[root@ve10:Active] config b rule myrule list
rule myrule {
when HTTP_RESPONSE {
if { [HTTP::is_redirect]} {
HTTP::header replace Location "[string map -nocase [list inside1.net fqdn.com inside2.net fqdn.com] [HTTP::header value Location]]"
}
}
}
original response
[root@ve10:Active] config curl -I http://200.200.200.101/something1
HTTP/1.1 302 Found
Date: Tue, 15 Jan 2013 04:17:33 GMT
Server: Apache/2.2.3 (CentOS)
Location: http://inside1.net/somethingone
Content-Type: text/html; charset=iso-8859-1
[root@ve10:Active] config curl -I http://200.200.200.101/something2
HTTP/1.1 302 Found
Date: Tue, 15 Jan 2013 04:17:34 GMT
Server: Apache/2.2.3 (CentOS)
Location: http://inside2.net/somethingtwo
Content-Type: text/html; charset=iso-8859-1
response through bigip
[root@ve10:Active] config curl -I http://172.28.19.252/something1
HTTP/1.1 302 Found
Date: Tue, 15 Jan 2013 04:19:27 GMT
Server: Apache/2.2.3 (CentOS)
Location: http://fqdn.com/somethingone
Content-Type: text/html; charset=iso-8859-1
[root@ve10:Active] config curl -I http://172.28.19.252/something2
HTTP/1.1 302 Found
Date: Tue, 15 Jan 2013 04:19:28 GMT
Server: Apache/2.2.3 (CentOS)
Location: http://fqdn.com/somethingtwo
Content-Type: text/html; charset=iso-8859-1
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