Forum Discussion
scott_sams_8256
Nimbostratus
Oct 22, 2007mixed irule?
i am new to irules so forgive my ignorance.
we use a simple irule as follows. i want to do a redirect to a url on the else (public inbound traffic) during maintenance).
when CLIEN...
hoolio
Cirrostratus
Oct 22, 2007You can only use an HTTP:: command once the HTTP has been parsed. The HTTP hasn't been parsed in the CLIENT_CONNECTED event, so the HTTP::redirect command is invalid. You can issue a redirect in the HTTP_REQUEST event though (when LTM parses the HTTP headers in a request). If you only want to redirect the client during a maintenance window, you could use a separate rule:
when HTTP_REQUEST {
checks to see if client_addr = any in the class
if { not ([matchclass [IP::client_addr] equals $::private_net])} {
HTTP::redirect http://maintenance.example.com
}
}Else, if you want to combine the two in the HTTP_REQUEST event, here's an example:
when HTTP_REQUEST {
checks to see if client_addr = any in the class
if { [matchclass [IP::client_addr] equals $::private_net]} {
snat automap
use pool g_pool
} else {
HTTP::redirect http://maintenance.example.com
snat none
use pool g_pool
}
}Aaron
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
