Forum Discussion
Glen_33414
Nimbostratus
Feb 13, 2013This should be easy
Okay, I am a total noob here and I'm trying to figure out my first iRule. I've spent the better part of yesterday looking for examples to plagiarize and I found one that looked perfect for what I am ...
nitass
Employee
Feb 13, 2013e.g.
[root@ve10:Active] config b virtual bar list
virtual bar {
snat automap
destination 172.28.19.252:80
ip protocol 6
rules myrule
profiles {
http {}
tcp {}
}
}
[root@ve10:Active] config b rule myrule list
rule myrule {
when HTTP_REQUEST {
if {[scan [HTTP::path] {/hangar%d} num] == 1} {
switch $num {
1 { node 200.200.200.101 }
2 { node 2.2.2.2 }
3 { node 3.3.3.3 }
4 { node 4.4.4.4 }
5 { node 5.5.5.5 }
default {
do something
}
}
HTTP::uri [string map "/hangar$num/ /" [HTTP::uri]]
} else {
do something
}
}
}
[root@ve10:Active] config ssldump -Aed -nni 0.0 port 80
New TCP connection 1: 172.28.19.251(49995) <-> 172.28.19.252(80)
1360764488.7196 (0.0010) C>S
---------------------------------------------------------------
GET /hangar1/services/reception 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
Accept: */*
Host: receptionservice.company.com
---------------------------------------------------------------
New TCP connection 2: 200.200.200.10(49995) <-> 200.200.200.101(80)
1360764488.7207 (0.0010) C>S
---------------------------------------------------------------
GET /services/reception 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
Accept: */*
Host: receptionservice.company.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