Policy
This package is used for fetching the policy configurations.
policy.name()
Return the string of the policy name.
Example
when HTTP_REQUEST {
debug("policy name is %s.\n", policy.name()
}
policy.http_ports()
Return a lua array with all HTTP ports. Port value is integer.
{ 80, 8080 }
Example
when HTTP_REQUEST {
for k,v in pairs(policy.http_ports()) do
debug("http port %s port is %s.\n", k, v)
end
}
policy.https_ports()
Return a lua array with all HTTPS port. Port value is integer.
{ 443, 8443 }
Example
when HTTP_REQUEST {
for k,v in pairs(policy.https_ports()) do
debug("https port %s port is %s.\n", k, v)
end
}
policy.crs()
Return lua array with all content routing names.
{ “cr1”, “cr2”, “cr3” }
Example
when HTTP_REQUEST {
for k,v in pairs(policy.crs()) do
debug("content routing name %s is %s.\n", k, v)
end
}
policy.servers() / policy.servers(“cr-name”)
Return lua array with all servers. If the policy has content routing, the caller should pass the “cr-name” argument to fetch the servers of the specific content routing.
Example
when HTTP_REQUEST {
for k,v in pairs(policy.servers()) do
debug("server %s details are %s.\n", k, v)
end
}