Forum Discussion
irule pool redirect based on port and host header
1) Does the 'when HTTP_REQUEST' filter based on port or traffic type
The HTTP events and commands are enabled when you apply an HTTP profile to the virtual server. It doesn't really matter what the actual port is, as long as the HTTP "filter" can detect HTTP-specific protocol data in the TCP payload.
2) Should/can i nest events - CLIENT_ACCEPTED/HTTP_REQUEST?
These events generally operate at different layers of the stack, so it's absolutely useful to use them both in a single iRule. How you use them depends on what you're trying to do though.
3) How would i add an if port is 123 go to pool_test_123, based on question 1, if this it HTTP traffic does the HTTP_REQUEST apply?
The important thing to understand here is the notion of connection-based context. In other words, context is based on a TCP connection/session. A CLIENT_ACCEPTED event happens first and can see all of the data at layer 4 (TCP payload, IP addresses, etc.). An HTTP_REQUEST event is triggered at layer 7 and can see all of the HTTP-specific protocol data - plus all of the data collected in earlier layers. So the following would be useful:
when HTTP_REQUEST {
if { [TCP::local_port] equals "123" } {
pool test_123_pool
} else {
pool normal_pool
}
}
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)Recent Discussions
Related Content
* 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