Appendix B Summary Examples of Advanced Expressions and Policies 241

Examples of Advanced Expressions and Policies

Purpose

Example

 

 

Limit the number of

add ns limitSelector ip_limit_selector

requests per second from a

http.req.url "client.ip.src"

URL.

add ns limitIdentifier ip_limit_identifier

 

 

-threshold 4 -timeSlice 3600 -mode

 

request_rate -limitType smooth -selectorName

 

ip_limit_selector

 

add responder action

 

my_Web_site_redirect_action redirect

 

"\"http://www.mycompany.com/\""

 

add responder policy

 

ip_limit_responder_policy

 

"http.req.url.contains(\"myasp.asp\") &&

 

sys.check_limit(\"ip_limit_identifier\")"

 

my_Web_site_redirect_action

 

bind responder global

 

ip_limit_responder_policy 100 END -type

 

default

Check the client IP

add rewrite policy check_client_ip_policy

address but pass a request

'HTTP.REQ.HEADER("x-forwarded-for").EXISTS

through unchanged

HTTP.REQ.HEADER("client-ip").EXISTS'

 

NOREWRITE

 

bind rewrite global check_client_ip_policy

 

100 END

Page 255
Image 255
Citrix Systems 9.2 manual Limit the number, Check the client IP, Through unchanged