Forum Discussion
Parveez_70209
Nimbostratus
Nov 01, 2013How to modify this Irule with HTTP_REQUEST replacing CLIENT_ACCEPTED
Kindly guide:
To delete the CLIENT_ACCEPTED part and replace the same with HTTP_REQUEST and Also to remove the IP SEGMENT PART: 172.27.64.0/22 Query: Incase, I keep CLIENT_ACCEPT and use 0.0.0....
Kevin_Stewart
Employee
Nov 01, 2013You should still be able to use the TCP::local_port command in the HTTP_REQUEST event, so:
when HTTP_REQUEST {
switch [TCP::local_port] {
"5000" {
pool example_ems
}
"5005" {
pool example_ems
}
"5100" {
pool example_webvis
}
"5105" {
pool example_webvis
}
"5110" {
pool example_recall
}
"5115" {
pool example_recall
}
"5200" {
pool example_recon
}
"5205" {
pool example_recon
}
"5400" {
pool example_hub
}
"5405" {
pool example_hub
}
default {
HTTP::redirect "https://[HTTP::host][HTTP::uri]"
}
}
}
You could also save yourself the hassle of a complex iRule by using a data group:
when HTTP_REQUEST {
if { [class match [TCP::local_port] equals my_datagroup] } {
pool [class match -value [TCP::local_port] equals my_datagroup]
} else {
HTTP::redirect "https://[HTTP::host][HTTP::uri]"
}
}
where "my_datagroup" is a string-based data group:
5000 := example_ems
5005 := example_ems
5100 := example_webvis
5105 := example_webvis
5110 := example_recall
5115 := example_recall
5200 := example_recon
5205 := example_recon
5400 := example_hub
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