Forum Discussion
Michael_Mangret
Nimbostratus
Aug 13, 2007Irule Error message
Can anyone tell me what might be wrong with my Irule? It seems to be working. I get the message Forbidden when I send a call with the header x-moz set, but I still get this error message in my log.
Error Message:
Aug 13 12:59:27 tmm tmm[715]: 01220001:3: TCL error: Rule xmoz_irule - can't read "host_pool": no such variable while executing "if { $host_pool ne "" } { pool $host_pool }"
Irule:
when HTTP_REQUEST {
if {[string tolower [HTTP::header x-moz:] ] contains "prefetch" } {
HTTP::respond 403 content "Forbidden"}
else {set host_pool [findclass [HTTP::host] $::DSHostPoolMap " "] }
if { $host_pool ne "" } {
pool $host_pool }
}
2 Replies
Sort By
- hoolio
Cirrostratus
You're getting the TCL error because $host_pool isn't being set for every request--but is being referenced in every request.when HTTP_REQUEST { if {[string tolower [HTTP::header x-moz:] ] contains "prefetch" } { HTTP::respond 403 content "Forbidden" } else { set host_pool [findclass [HTTP::host] $::DSHostPoolMap " "] } if { $host_pool ne "" } { pool $host_pool } }
when HTTP_REQUEST { if {[string tolower [HTTP::header x-moz]] eq "prefetch" } { HTTP::respond 403 content "Forbidden" } else { set host_pool [findclass [string tolower [HTTP::host]] $::DSHostPoolMap " "] if { $host_pool ne "" } { pool $host_pool } else { pool default_pool } } }
- Michael_Mangret
Nimbostratus
Thank you very much. I will try to add the defaul pool and see what happens.
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